AngularJS - refresh ng-repeat

后端 未结 5 734
Happy的楠姐
Happy的楠姐 2021-02-02 07:05

I\'m using ng-repeat to display a collection of values. My filter options changes according to an ajax call to server. How can I refresh the ng-repeat after the filter parameter

5条回答
  •  广开言路
    2021-02-02 07:18

    You need to tell angular that the values have changes:

    $scope.loadNewFilter = function (){
        $scope.filter = [1,2,3];      
        $scope.$apply();
    }
    

提交回复
热议问题