p.location-badge.
exported from angular2/directives
defined in angular2/src/directives/ng_if.ts (line 3)
:markdown
Removes or recreates a portion of the DOM tree based on an {expression}.
If the expression assigned to `ng-if` 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:
```
0" class="error">
{{errorCount}} errors detected
```
# Syntax
- `...
`
- `...
`
- `...
`
.l-main-section
h2 Annotations
.l-sub-section
h3.annotation Directive
pre.prettyprint
code.
@Directive({selector: '[ng-if]', properties: ['ngIf']})
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef)
:markdown
.l-sub-section
h3 viewContainer
:markdown
.l-sub-section
h3 templateRef
:markdown
.l-sub-section
h3 prevCondition
:markdown
.l-sub-section
h3 ngIf
:markdown