The binding of the isolate to =*lies in shallow observations of the change in the collection.
Let me clarify a bit:
Typically, watchCollection variables are used in scripts, as shown below:
$scope.arr = ['foo', 'bar', 'lorem', 'ipsum'];
$scope.arrCount = 4;
$scope.$watchCollection('arr', function(new, old) {
$scope.arrCount = new.length;
});
But what if you want to bind an object to an html attribute?
<my-directive my-attr="arr">
And if you do this:
scope: {
myAttr: "=*"
}
Now the attributes of the directive are assigned, since it should be a small clock. And using watchCollection is good to use this time.
, =* , (, $watchCollection $watch), = * or = attr (=? or = *? attr, ), docs.
= watchCollection, , =* . , =* , , $watchCollection , $watch , :
if (definition.collection) { //using `=*`
removeWatch = scope.$watchCollection(attrs[attrName], parentValueWatch);
} else { //using `=`
removeWatch = scope.$watch($parse(attrs[attrName],
parentValueWatch), null, parentGet.literal);
}
, collection, =*.