Once I turn off debuggingData in angular, is there another way to get the rootscope?

45 views Asked by At

I think having debugging info on by default in Angular will sink large apps. You can now disable this in production:

https://docs.angularjs.org/guide/production#disabling-debug-data

But there are some cases where I do:

angular.element(document).scope()

in order to access the rootScope. Is there another way in angular to get the $rootScope without this debugging feature on?

1

There are 1 answers

1
Pankaj Parkar On BEST ANSWER

To access $rootScope you could do

angular.element(document).injector().get('$rootScope')