How do I use $scope.$watch and $scope.$apply in AngularJS?

前端 未结 6 2169
栀梦
栀梦 2020-11-21 15:36

I don\'t understand how to use $scope.$watch and $scope.$apply. The official documentation isn\'t helpful.

What I don\'t understand specifi

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-21 16:00

    There are $watchGroup and $watchCollection as well. Specifically, $watchGroup is really helpful if you want to call a function to update an object which has multiple properties in a view that is not dom object, for e.g. another view in canvas, WebGL or server request.

    Here, the documentation link.

提交回复
热议问题