Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
AngularJS

ng-if in AngularJS

Conditionally add/remove DOM nodes with ng-if.

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>

Leave a reply

Your email address will not be published. Required fields are marked *