How to execute "angular.element().scope()" in Protractor? -


i'd access scopes of angular app module this

var scopes = angular.element(document.queryselectorall('[ng-app]')).scope(); 

but can't figure out how use in protractor. tried:

1) var scopes = element(by.css(['ng-app'])).scope() 2) var scopes = angular.element(document.queryselectorall('[ng-app]')).scope() 

but of these 2 options return "undefined not function" or 2nd option "angular not defined"

thanks in advance

thanks @alecxe. if wrap code mentioned above in

browser.executeasyncscript 

it work


Comments