YouTip LogoYouTip

Ng Ng If

# AngularJS `ng-if` Directive [![Image 3: AngularJS Reference](#) AngularJS Reference](#) * * * ## AngularJS Example Uncheck to remove the content: Keep HTML:

Welcome

Welcome to my home.


[Try it Β»](#) * * * ## Definition and Usage The **ng-if** directive removes the HTML element if the expression evaluates to false. If the if statement evaluates to true, the element is added and displayed. The **ng-if** directive is different from ng-hide, which hides elements. **ng-if** removes the element from the DOM. * * * ## Syntax All HTML elements support this directive. * * * ## Parameter Values | Value | Description | | --- | --- | | _expression_ | If the expression returns false, the entire element is removed. If it returns true, the element is added. | * * AngularJS Reference](#)
← Ionic IonicbackdropNg Ng Hide β†’