Get the App
SLTechnology News&Howtos  ›  Development  › 

How to implement $watch in angular

Shulou Source: shulou.com Published: 2022-06-03 19:27:54 11月12日 Update

This article will explain in detail how to achieve $watch in angular. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Code

$scope.$watch ('custArea', function (newValue, oldValue) {angular.forEach (newValue, function (item, key) {if ($scope.custArea.indexOf ("000000") >-1) {/ / $scope.toastWarn ("all provinces and cities of Chinese mainland have been selected, other values are not selectable"); $scope.custArea = ["000000"];} else {});}, true) This is the end of the article on "how to achieve $watch in angular". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Articles more good practical code content mainland articles provinces and cities knowledge China reference help related selection Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn NVidia Docker Xiaomi Shulou Technology