if ('angular' in window) {
  angular.module('ng').run(['$rootScope', '$window', function ($rootScope, window) {

  	$rootScope.$watch(function() {
		  return $window.location.pathname + $window.location.search;
  	}, function (newUrl, oldUrl) {
      if (newUrl === oldUrl) {
        return;
      }
      
      var evt = document.createEvent('CustomEvent');
      evt.initCustomEvent('spriteLoaderLocationUpdated', false, false, {
        newUrl: newUrl
      });
      window.dispatchEvent(evt);
    });
  }]);
}

if ('angular' in window) {
  angular.module('ng').run(['$rootScope', '$location', function ($rootScope, $location) {

  	function updateEventEmitter(e, newUrl) {
      var evt = document.createEvent('CustomEvent');
      evt.initCustomEvent('spriteLoaderLocationUpdated', false, false, {
        newUrl: newUrl
      });
      window.dispatchEvent(evt);
    }

  	$rootScope.$watch(function() {
		return $location.url();
  	}, updateEventEmitter);
  }]);
}

--- 
+++ 
@@ -1,16 +1,18 @@
 if ('angular' in window) {
-  angular.module('ng').run(['$rootScope', '$location', function ($rootScope, $location) {
+  angular.module('ng').run(['$rootScope', '$window', function ($rootScope, window) {
 
-  	function updateEventEmitter(e, newUrl) {
+  	$rootScope.$watch(function() {
+		  return $window.location.pathname + $window.location.search;
+  	}, function (newUrl, oldUrl) {
+      if (newUrl === oldUrl) {
+        return;
+      }
+      
       var evt = document.createEvent('CustomEvent');
       evt.initCustomEvent('spriteLoaderLocationUpdated', false, false, {
         newUrl: newUrl
       });
       window.dispatchEvent(evt);
-    }
-
-  	$rootScope.$watch(function() {
-		return $location.url();
-  	}, updateEventEmitter);
+    });
   }]);
 }
Watch only path and search
