Kanagasabai NK Kanagasabai NK - 5 months ago 18
AngularJS Question

How can we use Multiple ng-if methods in a same div in angularjs

Is there is any possibility for using Multiple ng-if methods in a same div
example:

<div ng-if="condition1">
<!-- code to render -->
<div ng-if="condition2">
<!-- code to render -->
</div>
<div ng-if="condition3">
<!-- code to render -->
</div>
</div>

Answer

You can create multiple ng-if conditions

<div ng-app>
<div ng-if="true">
<!-- code to render -->
  div1
 <div ng-if="true">
 <!-- code to render -->
   div2
</div>
 <div ng-if="false">
   div3
 <!-- code to render -->
</div>
</div>
</div>

http://codepen.io/nagasai/pen/aZpVpz