问题描述:

Suppose we have a variable defined as

 $scope.name = 'myName'

how can I return it from a function within JavaScript like so

function returnVar(){

alert 'this is the variable in Scope': name;

}

网友答案:

See Below link for your solution:

https://coderwall.com/p/smkwhg/access-scope-outside-of-angularjs

Also Stackoverflow link which have same type of discussion: How to access the $scope variable in browser's console using AngularJS?

相关阅读:
Top