廢話不多說,直接上代碼
$scope.$watch('custArea', function(newValue, oldValue) { angular.forEach(newValue, function(item, key) { if($scope.custArea.indexOf("000000") > -1){ // $scope.toastWarn("已選擇中國(guó)大陸所有省市,其他值不可選"); $scope.custArea =["000000"]; }else{} }); }, true);以上這篇angular $watch 一個(gè)變量的變化(實(shí)例講解)就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持錯(cuò)新站長(zhǎng)站。
新聞熱點(diǎn)
疑難解答
圖片精選