「link」属性の「num」にアクセスしたいと思います。しかし、私はただすることはできませんvalue={{num}}
。それを行う適切な方法は何ですか?
HTML
<div class="customDirective" ng-repeat="num in [1,2,3]"></div>
指令
function customDirective(loggedUserService) {
return{
restrict: "C",
link: function (scope, element, attrs) {
//I would like to access num
},
template: "<div>some stuff</div>"
};
}
app = angular
.module('myApp', [])
.directive('customDirective', customDirective)