Is it possible to dynamically add an attribute ng-repeat
to an element? If so, how?
EDIT
I tried to create a component that will use its own template inside it for each element in its list.
Example
<custom-component>
<item-template>
<span>{{item.name}}</span>
<item-template>
<custom-component>
Then the result should be
<custom-component>
<ul>
<li ng-repeat="item in $ctrl.items">(the template)</li>
</ul>
</custom-component>
So, I tried just setting innerHTML for ul to a string like this:
ul.innerHtml = "<li ng-repeat="item in $ctrl.items">{{item.name}}</li>"
source
share