Reacting on angular events in a directive without injecting $rootScope
I wonder if you have an example of a directive code that reacts on angular events like $routeChangeError without injecting $rootScope in to it (to use $on in link function). It breaks in my opinion MV* pattern and "produces" smell-code (gives the possibility to manipulate root scope in a directive). Thanks in advance. If you are only listening for events, you don't have to use the $rootScope ; do e.g. $scope.$on("$routeChangeError") on the scope of the directive, from either controller or link function. You see the "$routeChangeError" is broadcasted from the $rootScope , so all children