I've done a couple projects in the past that use AngularJS. In development, I was always able to call $scope in the browser console and thus all of its variables. For example, $scope.myArray
would return something like []
or [object1, object2]
.
However, now when I type in $scope
, I get:
Uncaught ReferenceError: $scope is not defined
I've also looked at other posts like How to access the $scope variable in browser's console using AngularJS?, and it is suggested to use angular.element($0).scope()
, but when I type that in the console, I get:
undefined
and I can't access objects like myArray
even though I know it is being created. Does anyone know what changed?
EDIT: I'm running into this problem also when I try code from previous projects that I were once able to access $scope for, so that makes me think it's not a simple implementation error.