页面使用了ng-repeat生成了view。在controller里修改了ng-repeat的ng-model。view没有修改是什么么?
$scope.search = function(page){
$scope.orData.page = page==0?1:page;
$scope.$watch("orData", function(){
orderService.searchData($scope.orData).then(function(res){
$scope.res = res.data;
if ($scope.res != undefined) {
if ($scope.res.page_items.length == 0) {
alert("没有订单数据");
}else{
$scope.tds = $scope.res.page_items;
$timeout(function(){
console.log($scope.tds);
}, 1000);
};
}else{
$scope.tds = "";
$("#orPaging").empty();
alert("订单号不能为非数字");
};
});
});
};
//
{{td.tid}}
{{td.created}}
{{td.buyer_nick}}
{{td.payment}}
{{td.shop_name}}
{{td.title}}
{{td.seller_memo}}
{{td.shipping_type}}
{{td.status}}
{{td.receiver_name}}
第一次刷新$scope.tds,view是有改变的。但是再次给$scope.tds赋值,view就不再改变了。
但是如果$scope.tds的长度有变,view又会变了,这是为什么呢?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
欢迎选择我的课程,让我们一起见证您的进步~~