I'm using Angular JS. I loop out a part of a scope that from the start is a JSON array.
I need to check for if a value in that array exists. If it does it should do something. The following code work but I can't figure out a way to save "status" temporary.
<div ng-repeat="item_value in item['slug'].values">
{{item_value}}
<div ng-if="item_value == 'dogs_cats'">
Somehow save "status" to true when above is equal.
</div>
</div>
<div ng-if="status == 'true'">
Do someting here.
</div>
Maybe my approach is wrong. Maybe this should not go in the template? I like different solutions to choose from and suggestions on which would be prefered.
ng-show="item_value == 'dogs_cats'"
? – Sergiu Paraschiv Jun 27 '14 at 9:20