I just started using angularjs, and now paging and querying are done by the background,
So I think it might be good if I use $http again to update $scope
But now ng-repeat is in search( ) I can receive the data and the page does not change
This is my current code.
js
app.controller('checkpoint', function($scope, $http) { //getData to list $http({ method: 'post', url: '../list', }).then(function successCallback(response) { $scope.checkpoint = response.data.datas.list; }, function errorCallback(response) { console.log('请求错误'); }); //search $scope.search = function (){ $http({ method: 'post', params :{keyword:$scope.query}, url: '../list', }).then(function successCallback(response) { console.log(response.data.datas.list) $scope.checkpoint = response.data.datas.list; }, function errorCallback(response) { console.log('请求错误'); }); }; });
html
...
{{ x.projectCode }} {{ x.station }} {{ x.code }} {{ x.circuit }} {{ x.name }} {{ x.item }} {{ x.description }} {{ x.watchedAssetCode }} ...
Where is the search method triggered?
I discovered during inspection that there is an extra
in the middle of the layout which was not visible on the pageMaybe angular needs to be compiled again, and there are many pitfalls. . .