The fact that Angular allows DOM manipulation means that the input markup into the compilation process sometimes differ from the output. Particularly, some input markup may be cloned a few times (like with ng-repeat
) before being rendered to the DOM.
Angular terminology is a bit inconsistent, but it still distinguishes between two types of markups:
The following markup demonstrates this:
<div ng-repeat="i in [0,1,2]">
<my-directive>{{i}}</my-directive>
</div>
The source html defines
<my-directive>{{i}}</my-directive>
which serves as the source template.
But as it is wrapped within an ng-repeat
directive, this source template will be cloned (3 times in our case). These clones are instance template, each will appear in the DOM and be bound to the relevant scope.