Skip to content

Instantly share code, notes, and snippets.

@F1LT3R
Last active October 15, 2015 16:15
Show Gist options
  • Save F1LT3R/8748333c3523daf0d6d8 to your computer and use it in GitHub Desktop.
Save F1LT3R/8748333c3523daf0d6d8 to your computer and use it in GitHub Desktop.
// Trying to get the controller's $scope
browser.executeScript(function () {
return angular.element(document.getElementById('app')).scope();
}).then(function($scope){
console.log($scope);
});
// Returns null for me even though my controller is running in #app element
@rbinsztock
Copy link

function getAngularVersion() {
return window.angular.version.full;
}

browser.executeScript(getAngularVersion).then(function (version) {
console.log(version);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment