docs: add input docs (#27376)

PR Close #27376
This commit is contained in:
Judy Bogart 2019-01-21 09:45:50 -08:00 committed by Alex Rickabaugh
parent 661a98aeda
commit 589dd479e2
1 changed files with 9 additions and 0 deletions

View File

@ -160,12 +160,18 @@ export class NgIf {
this._thenTemplateRef = templateRef; this._thenTemplateRef = templateRef;
} }
/**
* The Boolean expression to evaluate as the condition for showing a template.
*/
@Input() @Input()
set ngIf(condition: any) { set ngIf(condition: any) {
this._context.$implicit = this._context.ngIf = condition; this._context.$implicit = this._context.ngIf = condition;
this._updateView(); this._updateView();
} }
/**
* A template to show if the condition expression evaluates to true.
*/
@Input() @Input()
set ngIfThen(templateRef: TemplateRef<NgIfContext>|null) { set ngIfThen(templateRef: TemplateRef<NgIfContext>|null) {
assertTemplate('ngIfThen', templateRef); assertTemplate('ngIfThen', templateRef);
@ -174,6 +180,9 @@ export class NgIf {
this._updateView(); this._updateView();
} }
/**
* A template to show if the condition expression evaluates to false.
*/
@Input() @Input()
set ngIfElse(templateRef: TemplateRef<NgIfContext>|null) { set ngIfElse(templateRef: TemplateRef<NgIfContext>|null) {
assertTemplate('ngIfElse', templateRef); assertTemplate('ngIfElse', templateRef);