CanLoad

Stable Interface What it does Indicates that a class can implement to be a guard deciding if a children can be loaded. How to use class UserToken {} class Permissions { canLoadChildren(user: UserToken, id: string): boolean { return true; } } @Injectable() class CanLoadTeamSection implements CanLoad { constructor(private permissions: Permissions, private currentUser: UserToken) {} canLoad(route: Route( route: Route ): Observable<boolean>|Promise<boolean>|bool

OnDestroy

Stable Class What it does Lifecycle hook that is called when a directive or pipe is destroyed. How to use . @Component({selector: 'my-cmp', template: `...`}) class MyComponent implements OnDestroy { ngOnDestroy() { // ... } } Class Overview class OnDestroy { ngOnDestroy() : void } Class Description ngOnDestroy callback is typically used for any custom cleanup that needs to occur when the instance is destroyed. See Lifecycle Hooks Guide. Class Details ngOnDestroy() : void

JSONPConnection

Experimental Class Class Overview class JSONPConnection { readyState : ReadyState request : Request response : Observable<Response> finished(data?: any) : void } Class Description Abstract base class for an in-flight JSONP request. Class Details readyState : ReadyState The ReadyState of this request. request : Request The outgoing HTTP request. response : Observable<Response> An observable that completes with the response, when the request is finished. finished(dat

BrowserTestingModule

Stable Class Class Overview class BrowserTestingModule { } Class Description NgModule for testing. Annotations @NgModule({ exports: [BrowserModule], providers: [ {provide: APP_ID, useValue: 'a'}, ELEMENT_PROBE_PROVIDERS, {provide: NgZone, useFactory: createNgZone}, {provide: AnimationDriver, useValue: AnimationDriver.NOOP} ] }) exported from @angular/platform-browser/testing/index, defined in @angular/platform-browser/testing/browser.ts

RouterState

Stable Interface What it does Represents the state of the router. How to use @Component({templateUrl:'template.html'}) class MyComponent { constructor(router: Router) { const state: RouterState = router.routerState; const root: ActivatedRoute = state.root; const child = root.firstChild; const id: Observable<string> = child.params.map(p => p.id); //... } } Interface Overview interface RouterState { snapshot : RouterStateSnapshot toString() : string }

platformWorkerAppDynamic

Experimental Const Variable Export export platformWorkerAppDynamic exported from @angular/platform-webworker-dynamic/index defined in @angular/platform-webworker-dynamic/src/platform-webworker-dynamic.ts

TestComponentRenderer

Experimental Class Class Overview class TestComponentRenderer { insertRootElement(rootElementId: string) } Class Description An abstract class for inserting the root test component element in a platform independent way. Class Details insertRootElement(rootElementId: string) exported from @angular/core/testing/index, defined in @angular/core/testing/test_bed.ts

UrlSegment

Stable Class What it does Represents a single URL segment. How to use @Component({templateUrl:'template.html'}) class MyComponent { constructor(router: Router) { const tree: UrlTree = router.parseUrl('/team;id=33'); const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET]; const s: UrlSegment[] = g.segments; s[0].path; // returns 'team' s[0].parameters; // returns {id: 33} } } Class Overview class UrlSegment { constructor(path: string, parameters: {[key: s

ResolvedReflectiveProvider

Experimental Interface Interface Overview interface ResolvedReflectiveProvider { key : ReflectiveKey resolvedFactories : ResolvedReflectiveFactory[] multiProvider : boolean } Interface Description An internal resolved representation of a Provider used by the Injector. It is usually created automatically by Injector.resolveAndCreate. It can be created manually, as follows: Example (live demo) var resolvedProviders = Injector.resolve([{ provide: 'message', useValue: 'Hello' }]); var in

NavigationExtras

Stable Interface What it does Represents the extra options used during navigation. Interface Overview interface NavigationExtras { relativeTo : ActivatedRoute queryParams : Params fragment : string preserveQueryParams : boolean preserveFragment : boolean skipLocationChange : boolean replaceUrl : boolean } Interface Description Interface Details relativeTo : ActivatedRoute Enables relative navigation from the current ActivatedRoute. Configuration: [{ path: 'parent', co