Issue
How to access the scope variable widgets from chrome's console
function MyCntrl($scope) {
$scope.widgets = [
{text:'Widget #1', datarow:1, datacol:1, datasizex:3, datasizey:3},
{text:'Widget #2', datarow:2, datacol:1, datasizex:3, datasizey:3},
{text:'Widget #3', datarow:1, datacol:2, datasizex:3, datasizey:3},
{text:'Widget #4', datarow:2, datacol:2, datasizex:3, datasizey:3}
];
Something like $scope.widgets
simply doesn't work in the console!
Solution
The scope is bound to the DOM so you need to grab an element and use some angular code to get the scope.
Your best bet is to get an element that the Controller is bound to and have a look at the scope on that.
Here is the answer How do I access the $scope variable in browser's console using AngularJS?
Answered By - Will
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.