AfterViewInit

Stable Class What it does Lifecycle hook that is called after a component's view has been fully initialized. How to use . @Component({selector: 'my-cmp', template: `...`}) class MyComponent implements AfterViewInit { ngAfterViewInit() { // ... } } Class Overview class AfterViewInit { ngAfterViewInit() : void } Class Description See Lifecycle Hooks Guide. Class Details ngAfterViewInit() : void exported from @angular/core/index, defined in @angular/core/src/metadata/lifecyc

AfterViewChecked

Stable Class What it does Lifecycle hook that is called after every check of a component's view. How to use . @Component({selector: 'my-cmp', template: `...`}) class MyComponent implements AfterViewChecked { ngAfterViewChecked() { // ... } } Class Overview class AfterViewChecked { ngAfterViewChecked() : void } Class Description See Lifecycle Hooks Guide. Class Details ngAfterViewChecked() : void exported from @angular/core/index, defined in @angular/core/src/metadata/life

AfterContentInit

Stable Class What it does Lifecycle hook that is called after a directive's content has been fully initialized. How to use . @Component({selector: 'my-cmp', template: `...`}) class MyComponent implements AfterContentInit { ngAfterContentInit() { // ... } } Class Overview class AfterContentInit { ngAfterContentInit() : void } Class Description See Lifecycle Hooks Guide. Class Details ngAfterContentInit() : void exported from @angular/core/index, defined in @angular/core/sr

AfterContentChecked

Stable Class What it does Lifecycle hook that is called after every check of a directive's content. How to use . @Component({selector: 'my-cmp', template: `...`}) class MyComponent implements AfterContentChecked { ngAfterContentChecked() { // ... } } Class Overview class AfterContentChecked { ngAfterContentChecked() : void } Class Description See Lifecycle Hooks Guide. Class Details ngAfterContentChecked() : void exported from @angular/core/index, defined in @angular/core

ActivatedRouteSnapshot

Stable Interface What it does Contains the information about a route associated with a component loaded in an outlet at a particular moment in time. ActivatedRouteSnapshot can also be used to traverse the router state tree. How to use @Component({templateUrl:'./my-component.html'}) class MyComponent { constructor(route: ActivatedRoute) { const id: string = route.snapshot.params.id; const url: string = route.snapshot.url.join(''); const user = route.snapshot.data.user; } }

ActivatedRoute

Stable Interface What it does Contains the information about a route associated with a component loaded in an outlet. ActivatedRoute can also be used to traverse the router state tree. How to use @Component({templateUrl:'./my-component.html'}) class MyComponent { constructor(route: ActivatedRoute) { const id: Observable<string> = route.params.map(p => p.id); const url: Observable<string> = route.url.map(s => s.join('')); const user = route.data.map(d => d

AbstractFormGroupDirective

Stable Class Class Overview class AbstractFormGroupDirective { ngOnInit() : void ngOnDestroy() : void control : FormGroup path : string[] formDirective : Form validator : ValidatorFn asyncValidator : AsyncValidatorFn } Class Description This is a base class for code shared between NgModelGroup and FormGroupName. Class Details ngOnInit() : void ngOnDestroy() : void control : FormGroup Get the FormGroup backing this binding. path : string[] Get the path to this control gro

AbstractControlDirective

Stable Class Class Overview class AbstractControlDirective { control : AbstractControl value : any valid : boolean invalid : boolean pending : boolean errors : {[key: string]: any} pristine : boolean dirty : boolean touched : boolean untouched : boolean disabled : boolean enabled : boolean statusChanges : Observable<any> valueChanges : Observable<any> path : string[] reset(value?: any) : void } Class Description Base class for control directives.

AbstractControl

Stable Class What it does This is the base class for FormControl, FormGroup, and FormArray. It provides some of the shared behavior that all controls and groups of controls have, like running validators, calculating status, and resetting state. It also defines the properties that are shared between all sub-classes, like value, valid, and dirty. It shouldn't be instantiated directly. Class Overview class AbstractControl { constructor(validator: ValidatorFn, asyncValidator: AsyncValidatorF

7. Template Syntax

Learn how to write templates that display data and consume user events with the help of data binding. Our Angular application manages what the user sees and can do, achieving this through the interaction of a Component class instance (the component) and its user-facing template. Many of us are familiar with the component/template duality from our experience with model-view-controller (MVC) or model-view-viewmodel (MVVM). In Angular, the component plays the part of the controller/viewmodel, and