angularjs watch only once

在watch的对象前加上两个冒号'::'就能实现只watch一次

$scope.$watch('::something', function() {
    ...
});

评论

暂无评论