1、监听一个一个变量的值的变化

...
$scope.storeIns = null; //storeIns定义在$scope下
...
$scope.$watch('storeIns', (n, o) => { //storeIns为变量名称 n为变化后的值;o为变化前的值 //todo something })

2、监听多个变量的值

$scope.$watchGroup(['createDate','source'],function(n,o){
                //...
});

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案