NgIf

export directive NgIf

exported from angular2/common defined in angular2/src/common/directives/ng_if.ts (line 2)

Removes or recreates a portion of the DOM tree based on an {expression}.

If the expression assigned to ngIf evaluates to a false value then the element is removed from the DOM, otherwise a clone of the element is reinserted into the DOM.

Example (live demo):

<div *ngIf="errorCount > 0" class="error"> <!-- Error message displayed when the errorCount property on the current context is greater than 0. --> {{errorCount}} errors detected </div>

Syntax

Selectors

[ngIf]

Inputs

ng-if bound to NgIf.ngIf

Constructor

constructor(_viewContainer: ViewContainerRef, _templateRef: TemplateRef)

Not Yet Documented

Members

ngIf

Not Yet Documented