-1
rated 0 times
[
1]
[
2]
/ answers: 1 / hits: 18436
/ 11 Years ago, mon, september 23, 2013, 12:00:00
i've a array. Every item of the array holds data for an directive. The array is created inside a controller.
The Model
$scope.myDirectiveData =
[ { title: First title, content: First content },
{ title: Second title, content: Second content } ];
The Directive Template
<div class=MyDirective>
<h1>{{myDirectiveData.title}}</h1>
<p>{{myDirectiveData.content}}</p>
</div>
How should i implement the the directive to create a item for any item in the array ? Something like...
<MyDirective data-ng-repeat=item in myDirectiveData></MyDirective>
More From » angularjs