angularjs $watch old value and new value are the same

后端 未结 4 1068
忘了有多久
忘了有多久 2020-12-30 20:29

My intention is to watch a model within scope, and find difference between old value and new value.

However, I found old value and new value are all the same from th

4条回答
  •  温柔的废话
    2020-12-30 21:13

    The values are passed as parameters

    $scope.$watch('foo', function (newValue, oldValue) {
      // ...
    }
    

提交回复
热议问题