AngularJs $watch on $location.search doesn't work when reloadOnSearch is false

前端 未结 6 686
一向
一向 2020-12-08 01:53

My routeProvider for route has reloadOnSearch set to false :

 $routeProvider
     .when(
        \"/film/list\",
         


        
6条回答
  •  春和景丽
    2020-12-08 02:50

    In case you don't use Angular's route resolution or you just want to know whenever $location changes, there is an event just for that purpose

    $rootScope.$on('$locationChangeSuccess', function(event){
            var url = $location.url(),
                params = $location.search();
    })
    

提交回复
热议问题