angular $watch 一个变量的变化(实例讲解)
时间:2021-02-02 10:08:16|栏目:AngularJS|点击: 次
废话不多说,直接上代码
$scope.$watch('custArea', function(newValue, oldValue) {
angular.forEach(newValue, function(item, key) {
if($scope.custArea.indexOf("000000") > -1){
// $scope.toastWarn("已选择中国大陆所有省市,其他值不可选");
$scope.custArea =["000000"];
}else{}
});
}, true);






