Angular ng-if not true

user3289197 picture user3289197 · Oct 8, 2014 · Viewed 140.9k times · Source

Why doesn't this work.

<li ng-if="!area"></li>

Feels a bit illogical since

<li ng-if="area"></li>

works just fine.

'area' is defined in scope as true/false Any workarounds for this? I would prefer not to use ng-show/ng-hide since both of them renders items in DOM.

Answer

Sachin Sudhakar Sonawane picture Sachin Sudhakar Sonawane · Aug 22, 2015

use this

ng-if="area == false"

OR

ng-if="area == true"

this may help someone