0

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;
}
Imo
  • 1,455
  • 4
  • 28
  • 53

1 Answers1

3

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 do I access the $scope variable in browser's console using AngularJS?

Community
  • 1
  • 1
NeoAsh
  • 1,013
  • 1
  • 8
  • 11