diff --git a/goldens/public-api/router/router.md b/goldens/public-api/router/router.md index 142be1a55d..76b0fd2497 100644 --- a/goldens/public-api/router/router.md +++ b/goldens/public-api/router/router.md @@ -182,7 +182,6 @@ export type DetachedRouteHandle = {}; // @public type Event_2 = RouterEvent | RouteConfigLoadStart | RouteConfigLoadEnd | ChildActivationStart | ChildActivationEnd | ActivationStart | ActivationEnd | Scroll; - export { Event_2 as Event } // @public @@ -565,7 +564,7 @@ export class RouterLinkActive implements OnChanges, OnDestroy, AfterContentInit routerLinkActiveOptions: { exact: boolean; } | IsActiveMatchOptions; - } +} // @public export class RouterLinkWithHref implements OnChanges, OnDestroy { @@ -627,16 +626,18 @@ export class RouterOutlet implements OnDestroy, OnInit, RouterOutletContract { ngOnDestroy(): void; // (undocumented) ngOnInit(): void; - } +} // @public export interface RouterOutletContract { activatedRoute: ActivatedRoute | null; activatedRouteData: Data; + activateEvents?: EventEmitter; activateWith(activatedRoute: ActivatedRoute, resolver: ComponentFactoryResolver | null): void; attach(ref: ComponentRef, activatedRoute: ActivatedRoute): void; component: Object | null; deactivate(): void; + deactivateEvents?: EventEmitter; detach(): ComponentRef; isActivated: boolean; } @@ -650,7 +651,7 @@ export class RouterPreloader implements OnDestroy { preload(): Observable; // (undocumented) setUpPreloading(): void; - } +} // @public export class RouterState extends ɵangular_packages_router_router_m { @@ -788,7 +789,6 @@ export class UrlTree { // @public (undocumented) export const VERSION: Version; - // (No @packageDocumentation comment for this package) ``` diff --git a/packages/router/src/directives/router_outlet.ts b/packages/router/src/directives/router_outlet.ts index 34c158262e..6e363e7565 100644 --- a/packages/router/src/directives/router_outlet.ts +++ b/packages/router/src/directives/router_outlet.ts @@ -6,8 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {Attribute, ChangeDetectorRef, ComponentFactoryResolver, ComponentRef, Directive, EventEmitter, Injector, OnDestroy, OnInit, Output, ViewContainerRef} from '@angular/core'; - +import {Attribute, ChangeDetectorRef, ComponentFactoryResolver, ComponentRef, Directive, EventEmitter, Injector, OnDestroy, OnInit, Output, ViewContainerRef,} from '@angular/core'; import {Data} from '../config'; import {ChildrenOutletContexts} from '../router_outlet_context'; import {ActivatedRoute} from '../router_state'; @@ -72,6 +71,16 @@ export interface RouterOutletContract { * Called when the `RouteReuseStrategy` instructs to re-attach a previously detached subtree. */ attach(ref: ComponentRef, activatedRoute: ActivatedRoute): void; + + /** + * Emits an activate event when a new component is instantiated + **/ + activateEvents?: EventEmitter; + + /** + * Emits a deactivate event when a component is destroyed. + */ + deactivateEvents?: EventEmitter; } /**