UNPKG

2.63 kBTypeScriptView Raw
1import { DynamicComponentLoader, OnDestroy, ViewContainerRef } from '@angular/core';
2import { EventEmitter } from '../facade/async';
3import { ComponentInstruction } from '../instruction';
4import * as routerMod from '../router';
5/**
6 * A router outlet is a placeholder that Angular dynamically fills based on the application's route.
7 *
8 * ## Use
9 *
10 * ```
11 * <router-outlet></router-outlet>
12 * ```
13 */
14export declare class RouterOutlet implements OnDestroy {
15 private _viewContainerRef;
16 private _loader;
17 private _parentRouter;
18 name: string;
19 private _componentRef;
20 private _currentInstruction;
21 activateEvents: EventEmitter<any>;
22 constructor(_viewContainerRef: ViewContainerRef, _loader: DynamicComponentLoader, _parentRouter: routerMod.Router, nameAttr: string);
23 /**
24 * Called by the Router to instantiate a new component during the commit phase of a navigation.
25 * This method in turn is responsible for calling the `routerOnActivate` hook of its child.
26 */
27 activate(nextInstruction: ComponentInstruction): Promise<any>;
28 /**
29 * Called by the {@link Router} during the commit phase of a navigation when an outlet
30 * reuses a component between different routes.
31 * This method in turn is responsible for calling the `routerOnReuse` hook of its child.
32 */
33 reuse(nextInstruction: ComponentInstruction): Promise<any>;
34 /**
35 * Called by the {@link Router} when an outlet disposes of a component's contents.
36 * This method in turn is responsible for calling the `routerOnDeactivate` hook of its child.
37 */
38 deactivate(nextInstruction: ComponentInstruction): Promise<any>;
39 /**
40 * Called by the {@link Router} during recognition phase of a navigation.
41 *
42 * If this resolves to `false`, the given navigation is cancelled.
43 *
44 * This method delegates to the child component's `routerCanDeactivate` hook if it exists,
45 * and otherwise resolves to true.
46 */
47 routerCanDeactivate(nextInstruction: ComponentInstruction): Promise<boolean>;
48 /**
49 * Called by the {@link Router} during recognition phase of a navigation.
50 *
51 * If the new child component has a different Type than the existing child component,
52 * this will resolve to `false`. You can't reuse an old component when the new component
53 * is of a different Type.
54 *
55 * Otherwise, this method delegates to the child component's `routerCanReuse` hook if it exists,
56 * or resolves to true if the hook is not present.
57 */
58 routerCanReuse(nextInstruction: ComponentInstruction): Promise<boolean>;
59 ngOnDestroy(): void;
60}