jjzjj

watchCollection

全部标签

javascript - AngularJS 中的 "=*"是什么

我遇到过这种isolatebinding规范的方式:scope:{property:"=*"}这里的星号是什么意思?有人可以举个例子吗? 最佳答案 Theisolatebindingwith=*istoshallowwatchforthechangeinthecollection.让我解释一下:通常我们在脚本中使用的watchCollection变量如下:$scope.arr=['foo','bar','lorem','ipsum'];$scope.arrCount=4;$scope.$watchCollection('arr',f