1

angular js ng-if inside ng-repeat not working My angularjs ng-if code

<div ng-controller="Ctrl">
   <div ng-repeat = "data in categories">
     <div ng-if="data.name == 'Sport' ">
          {{data.name}}
     </div> 
 </div>
</div> 
Roham Rafii
  • 2,929
  • 7
  • 35
  • 49
Angu
  • 862
  • 2
  • 13
  • 32

1 Answers1

0

In your fiddle you're using AngularJS 1.0.6. ng-if was introduced from 1.1.5. Change AngularJS version and your code will work.

http://jsfiddle.net/PQvQ2/760/

If you really need 1.0.6 (not suggested at all) you can change ng-if to ng-show. It will hide the other elements, but I repeat, I don't suggest it. Please upgrade to a newer AngularJS version.

Lorenzo Marcon
  • 8,029
  • 5
  • 38
  • 63