Учитывая этот HTML
<parent>
<child></child>
<child></child>
<child></child>
</parent>
Как мне включить все элементы <child>
внутри элемента <parent>
?
Вот что у меня есть:
angular.module('foo', [])
.component('parent', {
restrict: "E",
template: '<!-- template -->' +
'<ng-transclude></ng-transclude>',
transclude : true,
controller: function ($scope, $element) {
/* code */
}
})
.component('child', {
restrict: "E",
require: {
parent: '^parent',
},
template: '<!-- template -->',
controller: function ($scope, $element) {
/* code */
}
})
;
Однако, только первый <child>
включен.
Как я могу сделать так, чтобы все дети были зачтены?