NgIf

Stable Directive Class Overview class NgIf { constructor(_viewContainer: ViewContainerRef, _template: TemplateRef<Object>) ngIf } Selectors [ngIf] Class Description 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">

NgForm

Stable Directive What it does Creates a top-level FormGroup instance and binds it to a form to track aggregate form value and validation status. How to use As soon as you import the FormsModule, this directive becomes active by default on all <form> tags. You don't need to add a special selector. You can export the directive into a local template variable using ngForm as the key (ex: #myForm="ngForm"). This is optional, but useful. Many properties from the underlying FormGroup instan

NgFor

Stable Directive Class Overview class NgFor { constructor(_viewContainer: ViewContainerRef, _template: TemplateRef<NgForRow>, _differs: IterableDiffers, _cdr: ChangeDetectorRef) ngForOf : any ngForTrackBy : TrackByFn ngForTemplate ngOnChanges(changes: SimpleChanges) : void ngDoCheck() } Selectors [ngFor][ngForOf] Class Description The NgFor directive instantiates a template once per item from an iterable. The context for each instantiated template inherits from t

NgControlStatusGroup

Stable Directive Class Overview class NgControlStatusGroup { constructor(cd: ControlContainer) } Selectors [formGroupName] [formArrayName] [ngModelGroup] [formGroup] form:not([ngNoForm]) [ngForm] Class Description Directive automatically applied to Angular form groups that sets CSS classes based on control status (valid/invalid/dirty/etc). Constructor constructor(cd: ControlContainer) exported from @angular/forms/index, defined in @angular/forms/src/directives/ng_control_statu

NgControlStatus

Stable Directive Class Overview class NgControlStatus { constructor(cd: NgControl) } Selectors [formControlName] [ngModel] [formControl] Class Description Directive automatically applied to Angular form controls that sets CSS classes based on control status (valid/invalid/dirty/etc). Constructor constructor(cd: NgControl) exported from @angular/forms/index, defined in @angular/forms/src/directives/ng_control_status.ts

NgControl

Stable Class Class Overview class NgControl { name : string valueAccessor : ControlValueAccessor validator : ValidatorFn asyncValidator : AsyncValidatorFn viewToModelUpdate(newValue: any) : void } Class Description A base class that all control directive extend. It binds a FormControl object to a DOM element. Used internally by Angular forms. Class Details name : string valueAccessor : ControlValueAccessor validator : ValidatorFn asyncValidator : AsyncValidatorFn viewToMode

NgClass

Stable Directive What it does Adds and removes CSS classes on an HTML element. How to use <some-element [ngClass]="'first second'">...</some-element> <some-element [ngClass]="['first', 'second']">...</some-element> <some-element [ngClass]="{'first': true, 'second': true, 'third': false}">...</some-element> <some-element [ngClass]="stringExp|arrayExp|objExp">...</some-element> Class Overview class NgClass { constructor(_iterableDiffers

NavigationStart

Stable Class What it does Represents an event triggered when a navigation starts. Class Overview class NavigationStart { constructor(id: number, url: string) id : number url : string toString() : string } Class Description Constructor constructor(id: number, url: string) Class Details id : number url : string toString() : string exported from @angular/router/index, defined in @angular/router/src/router.ts

NavigationExtras

Stable Interface What it does Represents the extra options used during navigation. Interface Overview interface NavigationExtras { relativeTo : ActivatedRoute queryParams : Params fragment : string preserveQueryParams : boolean preserveFragment : boolean skipLocationChange : boolean replaceUrl : boolean } Interface Description Interface Details relativeTo : ActivatedRoute Enables relative navigation from the current ActivatedRoute. Configuration: [{ path: 'parent', co

NavigationError

Stable Class What it does Represents an event triggered when a navigation fails due to an unexpected error. Class Overview class NavigationError { constructor(id: number, url: string, error: any) id : number url : string error : any toString() : string } Class Description Constructor constructor(id: number, url: string, error: any) Class Details id : number url : string error : any toString() : string exported from @angular/router/index, defined in @angular/router/s