DecimalPipe

Stable Pipe What it does Formats a number according to locale rules. How to use number_expression | number[:digitInfo] Formats a number as text. Group sizing and separator and other locale-specific configurations are based on the active locale. where expression is a number: digitInfo is a string which has a following format: {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits} minIntegerDigits is the minimum number of integer digits to use. Defaults to 1. minFractionDigits is the m

Testing

Techniques and practices for testing an Angular 2 app This chapter offers tips and techniques for testing Angular applications. Along the way you will learn some general testing principles and techniques but the focus is on Angular testing. Contents Introduction to Angular Testing Setup The first karma test The Angular Testing Platform (ATP) The sample application and its tests A simple component test Test a component with a service dependency Test a component with an async service Test a comp

ServiceMessageBroker

Experimental Class Class Overview class ServiceMessageBroker { registerMethod(methodName: string, signature: Type<any>[], method: Function, returnType?: Type<any>) : void } Class Description Helper class for UIComponents that allows components to register methods. If a registered method message is received from the broker on the worker, the UIMessageBroker deserializes its arguments and calls the registered method. If that method returns a promise, the UIMessageBroker returns

NavigationCancel

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

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

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

getModuleFactory()

Experimental Function Class Export export getModuleFactory(id: string) : NgModuleFactory<any> Returns the NgModuleFactory with the given id, if it exists and has been loaded. Factories for modules that do not specify an id cannot be retrieved. Throws if the module cannot be found. exported from @angular/core/index defined in @angular/core/src/linker/ng_module_factory_loader.ts

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