ng-if in AngularJS — a practical guide to AngularJS ng-if with clear examples you can reuse in real projects.
AngularJS Tutorial Series (26/99). Prefer one article? Read the complete AngularJS tutorial.
Short description
Unlike ng-show, ng-if destroys scope/DOM when false.
ng-if
<p ng-if="user">Welcome {{ user.name }}</p>
<p ng-if="!user">Please log in</p>