SystemJsNgModuleLoader

Experimental Class Class Overview class SystemJsNgModuleLoader { constructor(_compiler: Compiler, config?: SystemJsNgModuleLoaderConfig) load(path: string) : Promise<NgModuleFactory<any>> } Class Description NgModuleFactoryLoader that uses SystemJS to load NgModuleFactory Annotations @Injectable() Constructor constructor(_compiler: Compiler, config?: SystemJsNgModuleLoaderConfig) Class Details load(path: string) : Promise<NgModuleFactory<any>> expor

style()

Experimental Function Class Export export style(tokens: string | {[key: string]: string | number} | Array<string|{[key: string]: string | number}>) : AnimationStyleMetadata style is an animation-specific function that is designed to be used inside of Angular2's animation DSL language. If this information is new, please navigate to the component animations metadata page to gain a better understanding of how animations in Angular2 are used. style declares a key/value object containin

Structural Directives

Angular has a powerful template engine that lets us easily manipulate the DOM structure of our elements. One of the defining features of a single page application is its manipulation of the DOM tree. Instead of serving a whole new page every time a user navigates, whole sections of the DOM appear and disappear according to the application state. In this chapter we'll to look at how Angular manipulates the DOM and how we can do it ourselves in our own directives. In this chapter we will learn wh

state()

Experimental Function Class Export export state(stateNameExpr: string, styles: AnimationStyleMetadata) : AnimationStateDeclarationMetadata state is an animation-specific function that is designed to be used inside of Angular2's animation DSL language. If this information is new, please navigate to the component animations metadata page to gain a better understanding of how animations in Angular2 are used. state declares an animation state within the given trigger. When a state is active with

SpyNgModuleFactoryLoader

Stable Class What it does Allows to simulate the loading of ng modules in tests. How to use const loader = TestBed.get(NgModuleFactoryLoader); @Component({template: 'lazy-loaded'}) class LazyLoadedComponent {} @NgModule({ declarations: [LazyLoadedComponent], imports: [RouterModule.forChild([{path: 'loaded', component: LazyLoadedComponent}])] }) class LoadedModule {} // sets up stubbedModules loader.stubbedModules = {lazyModule: LoadedModule}; router.resetConfig([ {path: 'lazy', l

SpyLocation

Experimental Class Class Overview class SpyLocation { urlChanges : string[] setInitialPath(url: string) setBaseHref(url: string) path() : string isCurrentPathEqualTo(path: string, query?: string) : boolean simulateUrlPop(pathname: string) simulateHashChange(pathname: string) prepareExternalUrl(url: string) : string go(path: string, query?: string) replaceState(path: string, query?: string) forward() back() subscribe(onNext: (value: any) => void, onThrow?: (error:

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

SimpleChanges

Stable Interface Interface Overview interface SimpleChanges { } Interface Description A changes object whose keys are property names and values are instances of SimpleChange. See OnChanges exported from @angular/core/index, defined in @angular/core/src/metadata/lifecycle_hooks.ts

SimpleChange

Stable Class Class Overview class SimpleChange { constructor(previousValue: any, currentValue: any) previousValue : any currentValue : any isFirstChange() : boolean } Class Description Represents a basic change from a previous to a new value. Constructor constructor(previousValue: any, currentValue: any) Class Details previousValue : any currentValue : any isFirstChange() : boolean Check whether the new value is the first value assigned. exported from @angular/core/ind

setupTestingRouter()

Stable Function Class Export export setupTestingRouter(urlSerializer: UrlSerializer, outletMap: RouterOutletMap, location: Location, loader: NgModuleFactoryLoader, compiler: Compiler, injector: Injector, routes: Route[][]) Router setup factory function used for testing. exported from @angular/router/testing/index defined in @angular/router/testing/router_testing_module.ts