2016-10-09 11 views

答えて

2

Sajeetharan s'の答えは正しいですが、その唯一の現在のscope.Ifのためのあなたは、すべての状態変化のためにそれをしたい、この

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); 
のようにそれを追加
3

あなたは、コードのこの部分で行うことができ、

$scope.$on('$locationChangeStart', function(event) { 
    //add your logic 
}); 
関連する問題