在夜间监视中获取AngularJS范围

在夜间监视中获取AngularJS范围,angularjs,scope,Angularjs,Scope,我不熟悉Nightwatch,我只是想知道如何在Nightwatch中定义AngularJS元素 有没有办法完成这项任务 const getElementScope = (selector) => { cy.get(selector) .then(($el) => { cy.window() .its('angular') .then((n

我不熟悉Nightwatch,我只是想知道如何在Nightwatch中定义AngularJS元素

有没有办法完成这项任务

    const getElementScope = (selector) => {
        cy.get(selector)
            .then(($el) => { 
                cy.window()
                .its('angular')
                .then((ng) => {
                    console.log(ng.element($el).scope())
                    console.log("ng.element($el)", ng.element($el))
                })
            })
    }
在cypress中,我们可以得到角度范围,所以有没有办法得到角度范围

我尝试了下面的2,但它说范围和角度不是一个函数:

  1)browser.execute(function(){
      return $('#maincontent > div.container-fluid').scope();
    }, ['title'], function(result){
      console.log(result)
    });

  2)browser.execute(function(){
      return angular.element($('#maincontent > div.container-fluid')).scope();
    }, ['title'], function(result){
      console.log(result)
    });

请更好地描述你们的问题,把一些代码作为例子,因为旅游问题不太清楚。