FormControlDirective

Stable Directive What it does Syncs a standalone FormControl instance to a form control element. In other words, this directive ensures that any values written to the FormControl instance programmatically will be written to the DOM element (model -> view). Conversely, any values written to the DOM element through user input will be reflected in the FormControl instance (view -> model). How to use Use this directive if you'd like to create and manage a FormControl instance directly. S

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

withModule()

Experimental Function Class Export export withModule(moduleDef: TestModuleMetadata) : InjectSetupWrapper exported from @angular/core/testing/index defined in @angular/core/testing/test_bed.ts

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

EVENT_MANAGER_PLUGINS

Stable Const Variable Export export EVENT_MANAGER_PLUGINS exported from @angular/platform-browser/index defined in @angular/platform-browser/src/dom/events/event_manager.ts

Routes

Stable Type-alias What it does Represents router configuration. Interface Overview interface Routes { } Interface Description Routes is an array of route configurations. Each one has the following properties: path is a string that uses the route matcher DSL. pathMatch is a string that specifies the matching strategy. component is a component type. redirectTo is the url fragment which will replace the current matched segment. outlet is the name of the outlet the component should be p

ViewRef

Stable Class Class Overview class ViewRef { destroyed : boolean onDestroy(callback: Function) : any } Class Description Class Details destroyed : boolean onDestroy(callback: Function) : any exported from @angular/core/index, defined in @angular/core/src/linker/view_ref.ts

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

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

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