如何在嵌入模板中使用 ngRepeat 项目?可能吗?
指令模板:
<ng-transclude ng-repeat="record in records | filter1 | filter2"></ng-transclude>
指示:
app.directive('myDirective', function () {
return {
templateUrl: '/views/directives/mydirective.html',
restrict: 'A',
transclude: true,
scope: {
records: '='
}
};
});
控制器视图:
<div my-directive records="myRecords">
{{ myDirective.record }}
</div>