angularjs - generate element using ng-repeat but only show if condition met -
I want to generate an element using here menu json try it; Hope that ng-repeat , but only a few $ range I want to show activeMod is equal to the value of the item, how am I trying here but the ActiveMod value is not mod1 but it is showing all the list items Html code
& Lt; Ng-show = "item.temel =" = "{{Item.href}}" class = "{{item.className}}" & gt; {{item.title}} & lt; / a & gt; & lt; / li & gt;
{"title": "system", "menu-mod": "mod1", "className": "" "" "" " "" "" "" "" "Mod": "mod3", "className": "config-icon",}
& lt; Li ng-repeat = "item in menu" ng-show = "activeMod == item ['menu-mod']" ng-if = "item title! = 'Home'" & gt; & Lt; A ng-href = "{{item.href}}" class = "{{item.className}}" & gt; {{Item.title}} & lt; / A & gt; & Lt; / li & gt;
activeMod is declared in your controller.
Comments
Post a Comment