10

I'm trying to take advantage of AngularJS new fetures. One of them is :

$compileProvider.debugInfoEnabled(false);

The thing is that some pieces of my code rely on angular.element(el).scope() calls. So they won't work any longer.

Is there a way to rewrite angular.element(el).scope() expression to somehow get element's scope without debug info enabled?

dragonfly
  • 17,407
  • 30
  • 110
  • 219
  • I guess you need to get all scopes - http://stackoverflow.com/questions/10514147/in-angularjs-how-do-you-find-all-the-scopes-on-a-page - and manually search from it. attach $scope to dom manually to access it later. – YOU Oct 08 '15 at 09:31
  • possible duplicate https://stackoverflow.com/a/29833832/2460773 – Nitsan Baleli Jun 06 '17 at 06:46

2 Answers2

0

You can try this:

angular.element(el).controller()

Then you can access your scope functions and variables.

Bruno
  • 304
  • 4
  • 10
-2

type in console:

angular.reloadWithDebugInfo();
Abdul Rasheed
  • 6,486
  • 4
  • 32
  • 48