NgIf
Stable Directive
Обзор класса
class NgIf {
constructor(_viewContainer: ViewContainerRef, _template: TemplateRef<Object>)
ngIf
}
Селекторы
[ngIf]
Описание класса
Удаляет или воссоздаёт часть дерева DOM на основе {выражения}.
Если выражение, присвоенное ngIf, принимает ложное значение, то элемент удаляется из DOM, в противном случае клон элемента вставляется обратно в DOM.
Пример (живой пример):
<div *ngIf="errorCount > 0" class="error">
<!-- Error message displayed when the errorCount property in the current context is greater
than 0. -->
{{errorCount}} errors detected
</div>
Синтаксис
<div *ngIf="condition">...</div><div template="ngIf condition">...</div><template [ngIf]="condition"><div>...</div></template>
Конструктор
constructor(_viewContainer: ViewContainerRef, _template: TemplateRef<Object>)
Подробности класса
ngIf
экспортировано из @angular/common/index, определено в @angular/common/src/directives/ng_if.ts
© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v2.angular.io/docs/ts/latest/api/common/index/NgIf-directive.html