0
我想要包裝指令獲取元素並將事件綁定到它們。 我的標記是這樣的:ng-repeat的包裝指令找不到子元素
<div wrapping-directive>
<div ng-repeat='item in items'></div>
</div>
我要的是讓包裝指令中被NG重複創建的所有物品,像這樣:
app.directive('wrappingDirective', function() {
return function(scope, element, attrs) {
var items = element.find('div'); // this returns an empty array
// if i write $(element).find('div'); it returns an empty array as well
}
});