AngularJS: ng-include inside ng-repeat
HTML
<script src="http://ci.angularjs.org/view/AngularJS/job/angular.js-angular-master/lastSuccessfulBuild/artifact/build/angular.js"></script>
<a ng:click="tpl='tpl1.html'">tpl1.html</a> | <a ng:click="tpl='tpl2.html'">tpl2.html</a>
<h3>ng-include insise ng-repeat</h3>
<div ng-repeat="i in items">
<ng-include src="tpl" onload="log('onload inside repeater')"></ng-include>
</div>
<h3>just ng-include</h3>
<div ng-controller="Controller">
<ng-include src="tpl" onload="log('onload')"></ng-include>
</div>
<script type="text/ng-template" id="tpl1.html">
content 1
</script>
<script type="text/ng-template" id="tpl2.html">
content 2
</script>
JavaScript
function Controller($scope) {
$scope.log = function(m) {
console.log(m);
};
$scope.items = [1, 2];
}