Is it possible to access a property from the ng-repeat
scope in another directive within the same element as the ng-repeat
directive? For instance, I would like to be able to use the child.class
property in this scenario:
<div ng-class="{{ child.class }}" ng-repeat="child in parent.children">
{{ child.name }}
</div>
You can view an example of this not working in this JSFiddle link.
If accessing properties between directives is not feasible, what alternative methods could be employed to apply a class
to an element that utilizes ng-repeat
? Is there a way to handle the ng-repeat
function within a controller?