I have been working with Angular JS for long time now, but just now faced a strange issue where ng-if
is simply gets ignored with ng-repeat
.
This is the sample and simple code which doesn't work as expected
<ul ng-repeat="detail in details">
<span ng-if="2 == 3"> <!-- This should block the next tags to execute-->
<li>{{detail.name}}
<ul ng-repeat="detailed in details.name">
<li>{{detailed.prof}}</li>
</ul>
</li>
</span>
<span ng-if="2 === 2"> <!-- Instead this should get print -->
Print this (Updated)
</span>
</ul>
Here is my plunkr : https://plnkr.co/edit/xy4Qyd4tXm6kWROiaFVR?p=preview
use this version
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
or use ng-if
-> ng-show
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With