2016-10-09 5 views

Antwort

2

Sajeetharan s'Antwort richtig ist, aber es ist nur für aktuelle scope.If Sie es wollen für jede Statusänderung es so

run.$inject = ['$rootScope', '$location', '$cookieStore', '$http']; 

    function run($rootScope, $location, $cookieStore, $http) { 
    $rootScope.$on('$locationChangeStart', function(event, next, current) { 

      console.log($location.path()); 

     }); 
    } 
    app.run(run); 
hinzufügen
3

Mit diesem Stück Code tun,

$scope.$on('$locationChangeStart', function(event) { 
    //add your logic 
}); 
Verwandte Themen