Cookbook

Angular 2 Cookbook The Cookbook offers answers to common implementation questions. Each cookbook chapter is a collection of recipes focused on a particular Angular 2 feature or application challenge such as data binding, cross-component interaction, and communicating with a remote server via HTTP. The cookbook is just getting started. Many more recipes are on the way. Each cookbook chapter links to a live sample with every recipe included. Recipes are deliberately brief and code-centric. Each

createPlatform()

Experimental Function Class Export export createPlatform(injector: Injector) : PlatformRef Creates a platform. Platforms have to be eagerly created via this function. exported from @angular/core/index defined in @angular/core/src/application_ref.ts

createPlatformFactory()

Experimental Function Class Export export createPlatformFactory(parentPlaformFactory: (extraProviders?: Provider[]) => PlatformRef, name: string, providers?: Provider[]) : (extraProviders?: Provider[]) => PlatformRef Creates a factory for a platform exported from @angular/core/index defined in @angular/core/src/application_ref.ts

CookieXSRFStrategy

Experimental Class Class Overview class CookieXSRFStrategy { constructor(_cookieName?: string, _headerName?: string) configureRequest(req: Request) } Class Description XSRFConfiguration sets up Cross Site Request Forgery (XSRF) protection for the application using a cookie. See Cross-Site_RequestForgery(CSRF) for more information on XSRF. Applications can configure custom cookie and header names by binding an instance of this class with different cookieName and headerName values.

core

What it does Marks a class as an Angular component and collects component configuration metadata. How to use . @Component({selector: 'greet', template: 'Hello {{name}}!'}) class Greet { name: string = 'World'; } Description Component decorator allows you to mark a class as an Angular component and provide additional metadata that determines how the component should be processed, instantiated and used at runtime. Components are the most basic building block of an UI in an Angular applic

ControlContainer

Stable Class Class Overview class ControlContainer { name : string formDirective : Form path : string[] } Class Description A directive that contains multiple NgControls. Only used by the forms module. Class Details name : string formDirective : Form Get the form to which this container belongs. path : string[] Get the path to this container. exported from @angular/forms/index, defined in @angular/forms/src/directives/control_container.ts

ComponentFactory

Stable Class Class Overview class ComponentFactory { constructor(selector: string, _viewFactory: Function, _componentType: Type<any>) C selector : string componentType : Type<any> create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string|any) : ComponentRef<C> } Class Description Constructor constructor(selector: string, _viewFactory: Function, _componentType: Type<any>) Class Details C selector : string componentType :

ComponentFixtureAutoDetect

Experimental Const Variable Export export ComponentFixtureAutoDetect exported from @angular/core/testing/index defined in @angular/core/testing/test_bed.ts

ComponentFactoryResolver

Stable Class Class Overview class ComponentFactoryResolver { staticNULL : ComponentFactoryResolver resolveComponentFactory(component: Type<T>) : ComponentFactory<T> } Class Description Static Members NULL : ComponentFactoryResolver Class Details resolveComponentFactory(component: Type<T>) : ComponentFactory<T> exported from @angular/core/index, defined in @angular/core/src/linker/component_factory_resolver.ts

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