YouTip LogoYouTip

Ng Ng If

# AngularJS `ng-if` Directive [![Image 3: AngularJS Reference Manual](#) AngularJS Reference Manual](#) * * * ## AngularJS Example Uncheck, and remove content: Preserve HTML:

Welcome

Welcome to my home.


[Try it Yourself Β»](#) * * * ## Definition and Usage The **ng-if** directive is used to remove an HTML element if the expression evaluates to false. If the result of the if statement execution is true, the removed element will be added and displayed. The **ng-if** directive is different from ng-hide; ng-hide hides the element, whereas **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 will be removed; if true, the element will be added. | * * AngularJS Reference Manual](#)
← Css3 Pr Border Top Left RadiusNg Ng If β†’