I would like to save an object in a ngRepeat
so that I can use that object in its children, like shown in this code:
<div ng-repeat="bar in foo.bar>
<div ng-repeat="qux in baz.qux" myvalue="{'item1':foo.var1, 'item2':qux.var2}">
<div ng-click="myFirstFunction(myvalue)"></div>
<div ng-click="mySecondFunction(myvalue)"></div>
</div
</div
The object I want to generate and then use is rather large and I'd rather not define it repeatedly for each ngClick
directive.
I considered saving it into a scope variable but the object will change for each iteration of the ngRepeat
.
Is there a directive or an other way that I can use to store this value for later use?