javascript - Set value in HTML with AngularJS -


i'm using angular js. loop out part of scope start json array.

i need check if value in array exists. if should something. following code work can't figure out way save "status" temporary.

<div ng-repeat="item_value in item['slug'].values">     {{item_value}}     <div ng-if="item_value == 'dogs_cats'">         somehow save "status" true when above equal.     </div> </div> <div ng-if="status == 'true'">     someting here. </div> 

maybe approach wrong. maybe should not go in template? different solutions choose , suggestions on prefered.

i think do:

<div ng-if="item_value == 'dogs_cats'" ng-init="status = true">     somehow save "status" true when above equal. </div> 

but preferably should put logic in controller


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -