asNativeElements()

Experimental Function Class Export export asNativeElements(debugEls: DebugElement[]) : any exported from @angular/core/index defined in @angular/core/src/debug/debug_node.ts

TestabilityRegistry

Experimental Class Class Overview class TestabilityRegistry { constructor() registerApplication(token: any, testability: Testability) getTestability(elem: any) : Testability getAllTestabilities() : Testability[] getAllRootElements() : any[] findTestabilityInTree(elem: Node, findInAncestors?: boolean) : Testability } Class Description A global registry of Testability instances for specific elements. Annotations @Injectable() Constructor constructor() Class Details re

TestModuleMetadata

Experimental Type-alias Interface Overview interface TestModuleMetadata { } Interface Description exported from @angular/core/testing/index, defined in @angular/core/testing/test_bed.ts

AnimationStateMetadata

Experimental Class Class Overview class AnimationStateMetadata { } Class Description exported from @angular/core/index, defined in @angular/core/src/animation/metadata.ts

Visual Studio 2015 QuickStart

Use Visual Studio 2015 with the QuickStart files Some developers prefer Visual Studio as their Interactive Development Environment (IDE). This cookbook describes the steps required to set up and use the Angular 2 QuickStart files in Visual Studio 2015 within an ASP.NET 4.x project. There is no live example for this cookbook because it describes Visual Studio, not the application. ASP.NET 4.x Project The steps for setting up the QuickStart files with an ASP.NET 4.x project in Visual Studio 201

Hierarchical Injectors

Angular's hierarchical dependency injection system supports nested injectors in parallel with the component tree. We learned the basics of Angular Dependency injection in the Dependency Injection chapter. Angular has a Hierarchical Dependency Injection system. There is actually a tree of injectors that parallel an application's component tree. We can reconfigure the injectors at any level of that component tree with interesting and useful results. In this chapter we explore these points and wri

SlicePipe

Stable Pipe What it does Creates a new List or String containing a subset (slice) of the elements. How to use array_or_string_expression | slice:start[:end] NgModuleCommonModule Description Where the input expression is a List or String, and: start: The starting index of the subset to return. a positive integer: return the item at start index and all items after in the list or string expression. a negative integer: return the item at start index from the end and all items after in th

PlatformLocation

Stable Class Class Overview class PlatformLocation { getBaseHrefFromDOM() : string onPopState(fn: LocationChangeListener) : void onHashChange(fn: LocationChangeListener) : void pathname : string search : string hash : string replaceState(state: any, title: string, url: string) : void pushState(state: any, title: string, url: string) : void forward() : void back() : void } Class Description Class Details getBaseHrefFromDOM() : string onPopState(fn: LocationChangeListe

Ahead-of-Time Compilation

Learn how to use Ahead-of-time compilation This cookbook describes how to radically improve performance by compiling Ahead of Time (AoT) during a build process. Table of Contents Overview Ahead-of-Time vs Just-in-Time Compile with AoT Bootstrap Tree Shaking Load the bundle Serve the app Source Code Overview Angular component templates consist of a mix of standard html and Angular syntax (e.g. ngIf, ngFor). Expressions like ngIf and ngFor are specific to Angular. The browser cannot execute th

EventManager

Stable Class Class Overview class EventManager { constructor(plugins: EventManagerPlugin[], _zone: NgZone) addEventListener(element: HTMLElement, eventName: string, handler: Function) : Function addGlobalEventListener(target: string, eventName: string, handler: Function) : Function getZone() : NgZone } Class Description Annotations @Injectable() Constructor constructor(plugins: EventManagerPlugin[], _zone: NgZone) Class Details addEventListener(element: HTMLElement, event