SafeResourceUrl

Stable Interface Interface Overview interface SafeResourceUrl { } Interface Description Marker interface for a value that's safe to use as a URL to load executable code from. exported from @angular/platform-browser/index, defined in @angular/platform-browser/src/security/dom_sanitization_service.ts

SelectControlValueAccessor

Stable Directive Class Overview class SelectControlValueAccessor { constructor(_renderer: Renderer, _elementRef: ElementRef) value : any onChange : (_: any) => {} onTouched : () => {} writeValue(value: any) : void registerOnChange(fn: (value: any) => any) : void registerOnTouched(fn: () => any) : void setDisabledState(isDisabled: boolean) : void } Selectors select:not([multiple])[formControlName] select:not([multiple])[formControl] select:not([multiple])[n

ErrorHandler

Stable Class Class Overview class ErrorHandler { constructor(rethrowError?: boolean) handleError(error: any) : void } Class Description Provides a hook for centralized exception handling. The default implementation of ErrorHandler prints error messages to the Console. To intercept error handling, write a custom exception handler that replaces this default as appropriate for your app. Example class MyErrorHandler implements ErrorHandler { call(error, stackTrace = null, reason =

RenderComponentType

Experimental Class Class Overview class RenderComponentType { constructor(id: string, templateUrl: string, slotCount: number, encapsulation: ViewEncapsulation, styles: Array<string|any[]>, animations: {[key: string]: Function}) id : string templateUrl : string slotCount : number encapsulation : ViewEncapsulation styles : Array<string|any[]> animations : {[key: string]: Function} } Class Description Constructor constructor(id: string, templateUrl: string, slo

NgTemplateOutlet

Experimental Directive What it does Inserts an embedded view from a prepared TemplateRef How to use <template [ngTemplateOutlet]="templateRefExpression" [ngOutletContext]="objectExpression"> </template> Class Overview class NgTemplateOutlet { constructor(_viewContainerRef: ViewContainerRef) ngOutletContext ngTemplateOutlet ngOnChanges() } Selectors [ngTemplateOutlet] Class Description You can attach a context object to the EmbeddedViewRef by set

NgSwitchDefault

Stable Directive What it does Creates a view that is added to the parent NgSwitch when no case expressions match the switch expression. How to use <container-element [ngSwitch]="switch_expression"> <some-element *ngSwitchCase="match_expression_1">...</some-element> <some-other-element *ngSwitchDefault>...</some-other-element> </container-element> Class Overview class NgSwitchDefault { constructor(viewContainer: ViewContainerRef, templateRef: Tem

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

inject()

Stable Function Class Export export inject(tokens: any[], fn: Function) : () => any Allows injecting dependencies in beforeEach() and it(). Example: beforeEach(inject([Dependency, AClass], (dep, object) => { // some code that uses `dep` and `object` // ... })); it('...', inject([AClass], (object) => { object.doSomething(); expect(...); }) Notes: inject is currently a function because of some Traceur limitation the syntax should eventually becomes it('...', @Inject (object:

CanDeactivate

Stable Interface What it does Indicates that a class can implement to be a guard deciding if a route can be deactivated. How to use class UserToken {} class Permissions { canDeactivate(user: UserToken, id: string): boolean { return true; } } @Injectable() class CanDeactivateTeam implements CanDeactivate<TeamComponent> { constructor(private permissions: Permissions, private currentUser: UserToken) {} canDeactivate( component: TeamComponent, route: ActivatedRouteS

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