Response

Experimental Class Class Overview class Response { constructor(responseOptions: ResponseOptions) type : ResponseType ok : boolean url : string status : number statusText : string bytesLoaded : number totalBytes : number headers : Headers toString() : string } Class Description Creates Response instances from provided values. Though this object isn't usually instantiated by end-users, it is the primary object interacted with when it comes time to add data to a view

Connection

Experimental Class Class Overview class Connection { readyState : ReadyState request : Request response : any } Class Description Abstract class from which real connections are derived. Class Details readyState : ReadyState request : Request response : any exported from @angular/http/index, defined in @angular/http/src/interfaces.ts

RouterOutlet

Stable Directive What it does Acts as a placeholder that Angular dynamically fills based on the current router state. How to use <router-outlet></router-outlet> <router-outlet name='left'></router-outlet> <router-outlet name='right'></router-outlet> A router outlet will emit an activate event any time a new component is being instantiated, and a deactivate event when it is being destroyed. <router-outlet (activate)='onActivate($event)' (deactivat

NavigationEnd

Stable Class What it does Represents an event triggered when a navigation ends successfully. Class Overview class NavigationEnd { constructor(id: number, url: string, urlAfterRedirects: string) id : number url : string urlAfterRedirects : string toString() : string } Class Description Constructor constructor(id: number, url: string, urlAfterRedirects: string) Class Details id : number url : string urlAfterRedirects : string toString() : string exported from @angular

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

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

Component Interaction

Share information between different directives and components This cookbook contains recipes for common component communication scenarios in which two or more components share information. Table of contents Pass data from parent to child with input binding Intercept input property changes with a setter Intercept input property changes with ngOnChanges Parent listens for child event Parent interacts with child via a local variable Parent calls a ViewChild Parent and children communicate via a se

NgSwitch

Stable Directive What it does Adds / removes DOM sub-trees when the nest match expressions matches the switch expression. How to use <container-element [ngSwitch]="switch_expression"> <some-element *ngSwitchCase="match_expression_1">...</some-element> <some-element *ngSwitchCase="match_expression_2">...</some-element> <some-other-element *ngSwitchCase="match_expression_3">...</some-other-element> <ng-container *ngSwitchCase="match_expres

5. Services

We create a reusable service to manage our hero data calls Services The Tour of Heroes is evolving and we anticipate adding more components in the near future. Multiple components will need access to hero data and we don't want to copy and paste the same code over and over. Instead, we'll create a single reusable data service and learn to inject it in the components that need it. Refactoring data access to a separate service keeps the component lean and focused on supporting the view. It also m

resetFakeAsyncZone()

Experimental Function Class Export export resetFakeAsyncZone() Clears out the shared fake async zone for a test. To be called in a global beforeEach. exported from @angular/core/testing/index defined in @angular/core/testing/fake_async.ts