angular2
Version:
Angular 2 - a web framework for modern web apps
31 lines (30 loc) • 1.03 kB
TypeScript
import { ViewContainerRef, TemplateRef } from 'angular2/core';
/**
* 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](http://plnkr.co/edit/fe0kgemFBtmQOY31b4tw?p=preview)):
*
* ```
* <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
*
* - `<div *ngIf="condition">...</div>`
* - `<div template="ngIf condition">...</div>`
* - `<template [ngIf]="condition"><div>...</div></template>`
*/
export declare class NgIf {
private _viewContainer;
private _templateRef;
private _prevCondition;
constructor(_viewContainer: ViewContainerRef, _templateRef: TemplateRef);
ngIf: any;
}