fix(router): adjust ChildActivation events to only fire when the child is actually changing (#19043)

* The problem was with the `fireChildActivationStart` function. It was taking a `path` param, which was an
array of `ActivatedRouteSnapshot`s. The function was being fired for each piece of the route that was being
activated. This resulted in far too many `ChildActivationStart` events being fired, and being fired on routes
that weren't actually getting activated. This change fires the event only for those routes that are actually
being activated.

fixes #18942

PR Close #19043
This commit is contained in:
Jason Aden
2017-09-04 13:00:59 -07:00
committed by Miško Hevery
parent dce36751f5
commit 66f0ab0371
7 changed files with 186 additions and 39 deletions

View File

@ -61,17 +61,17 @@ export interface CanLoad {
/** @experimental */
export declare class ChildActivationEnd {
route: Route;
snapshot: ActivatedRouteSnapshot;
constructor(
route: Route);
snapshot: ActivatedRouteSnapshot);
toString(): string;
}
/** @experimental */
export declare class ChildActivationStart {
route: Route;
snapshot: ActivatedRouteSnapshot;
constructor(
route: Route);
snapshot: ActivatedRouteSnapshot);
toString(): string;
}