IterableDiffers

Stable Class Class Overview class IterableDiffers { staticcreate(factories: IterableDifferFactory[], parent?: IterableDiffers) : IterableDiffers staticextend(factories: IterableDifferFactory[]) : Provider constructor(factories: IterableDifferFactory[]) factories : IterableDifferFactory[] find(iterable: any) : IterableDifferFactory } Class Description A repository of different iterable diffing strategies used by NgFor, NgClass, and others. Constructor constructor(factories

ClassProvider

Stable Interface What it does Configures the Injector to return an instance of useClass for a token. How to use @Injectable() class MyService {} const provider: ClassProvider = {provide: 'someToken', useClass: MyService}; Interface Overview interface ClassProvider { provide : any useClass : Type<any> multi : boolean } Interface Description For more details, see the Dependency Injection Guide. Example abstract class Shape { name: string; } class Square extends Shape { n

NgModuleFactoryLoader

Stable Class Class Overview class NgModuleFactoryLoader { load(path: string) : Promise<NgModuleFactory<any>> } Class Description Used to load ng module factories. Class Details load(path: string) : Promise<NgModuleFactory<any>> exported from @angular/core/index, defined in @angular/core/src/linker/ng_module_factory_loader.ts

ExistingProvider

Stable Interface What it does Configures the Injector to return a value of another useExisting token. How to use const provider: ExistingProvider = {provide: 'someToken', useExisting: 'someOtherToken'}; Interface Overview interface ExistingProvider { provide : any useExisting : any multi : boolean } Interface Description For more details, see the Dependency Injection Guide. Example class Greeting { salutation = 'Hello'; } class FormalGreeting extends Greeting { salutation =

6. Dependency Injection

Angular's dependency injection system creates and delivers dependent services "just-in-time". Dependency injection is an important application design pattern. Angular has its own dependency injection framework, and we really can't build an Angular application without it. It's used so widely that almost everyone just calls it DI. In this chapter we'll learn what DI is and why we want it. Then we'll learn how to use it in an Angular app. Why dependency injection? Angular dependency injection Inje

Testability

Experimental Class Class Overview class Testability { constructor(_ngZone: NgZone) increasePendingRequestCount() : number decreasePendingRequestCount() : number isStable() : boolean whenStable(callback: Function) : void getPendingRequestCount() : number findBindings(using: any, provider: string, exactMatch: boolean) : any[] findProviders(using: any, provider: string, exactMatch: boolean) : any[] } Class Description The Testability service provides testing hooks that c

Location

Stable Class Class Overview class Location { staticnormalizeQueryParams(params: string) : string staticjoinWithSlash(start: string, end: string) : string staticstripTrailingSlash(url: string) : string constructor(platformStrategy: LocationStrategy) path(includeHash?: boolean) : string isCurrentPathEqualTo(path: string, query?: string) : boolean normalize(url: string) : string prepareExternalUrl(url: string) : string go(path: string, query?: string) : void replaceSta

platformBrowserDynamicTesting

Stable Const Variable Export export platformBrowserDynamicTesting exported from @angular/platform-browser-dynamic/testing/index defined in @angular/platform-browser-dynamic/testing/index.ts

Angular Module FAQs

Answers to frequently asked questions about @NgModule FAQs Angular Modules help organize an application into cohesive blocks of functionality. The Angular Modules chapter covers the concepts and takes you step by step from the most elementary @NgModule to a multi-faceted sample with lazy loaded modules. This chapter answers the questions many developers ask about Angular Module design and implementation. These FAQs assume that you have already read the Angular Module chapter. Declarations Wha

NgModuleRef

Stable Class Class Overview class NgModuleRef { injector : Injector componentFactoryResolver : ComponentFactoryResolver instance : T destroy() : void onDestroy(callback: () => void) : void } Class Description Represents an instance of an NgModule created via a NgModuleFactory. NgModuleRef provides access to the NgModule Instance as well other objects related to this NgModule Instance. Class Details injector : Injector The injector that contains all of the providers of the Ng