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

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

My routeProvider for route has reloadOnSearch set to false :

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


        
6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-08 02:43

    Use

    $scope.$watch(function(){ return $location.search() }, function(params){
        console.log(params);
    });
    

    instead.

提交回复
热议问题