Currently, I am utilizing Angular JS to iterate through a portion of a scope that is initially a JSON array.
My objective is to verify the existence of a specific value in that array. If the value exists, then certain actions should be taken. The code below achieves this functionality, however, I am struggling to find a way to temporarily store the "status" variable.
<div ng-repeat="item_value in item['slug'].values">
{{item_value}}
<div ng-if="item_value == 'dogs_cats'">
Find a method to set "status" to true if the condition above is met.
</div>
</div>
<div ng-if="status == 'true'">
Perform an action here.
</div>
I am open to alternative approaches and suggestions on whether this logic belongs in the template or not. It would be beneficial to have multiple solutions to choose from with recommendations on the preferred option.