The solution is "don't do that". IMO, if you find yourself needing to clear the $rootScope, you've made a fundamental architectural error. Are you adding stuff to the $rootScope and treating it like a global. Doing that is no different than polluting the window with global variables ... and it's "bad" for the same reasons. If you're need to guard views against unauthorized access, follow Pete's advice and have each view guard itself. If you're using routing to navigate views, you can make the router prevent unauthorized navigations.
-- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
