Skip to content

Comment on AngularJS Performance in Large Applicationsparent

Comments

I think the only way to do what you want with your service is by injecting rootScope and using $emit, since we're trying to capture a "logout" event and tell our other controllers about it.

Reacting to the specific event would likely waste less resources than pulling out the $watch or $watchCollection sledgehammer.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.