activateRoutes(state, storedState, storedUrl, id, url, rawUrl, skipLocationChange, replaceUrl, resolvePromise, rejectPromise) {
        // applied the new router state
        // this operation has side effects
        let /** @type {?} */ navigationIsSuccessful;
        state
            .forEach((p) => {
            if (typeof p === 'boolean' || !p.shouldActivate || id !== this.navigationId || !p.state) {
                navigationIsSuccessful = false;
                return;
            }
            const { appliedUrl, state } = p;
            this.currentUrlTree = appliedUrl;
            this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, rawUrl);
            (/** @type {?} */ (this)).routerState = state;
            if (!skipLocationChange) {
                const /** @type {?} */ path = this.urlSerializer.serialize(this.rawUrlTree);
                if (this.location.isCurrentPathEqualTo(path) || replaceUrl) {
                    this.location.replaceState(path, '', { navigationId: id });
                }
                else {
                    this.location.go(path, '', { navigationId: id });
                }
            }
            new ActivateRoutes(this.routeReuseStrategy, state, storedState, (evt) => this.triggerEvent(evt))
                .activate(this.rootContexts);
            navigationIsSuccessful = true;
        })
            .then(() => {
            if (navigationIsSuccessful) {
                this.navigated = true;
                this.lastSuccessfulId = id;
                (/** @type {?} */ (this.events))
                    .next(new NavigationEnd(id, this.serializeUrl(url), this.serializeUrl(this.currentUrlTree)));
                resolvePromise(true);
            }
            else {
                this.resetUrlToCurrentUrlTree();
                (/** @type {?} */ (this.events))
                    .next(new NavigationCancel(id, this.serializeUrl(url), ''));
                resolvePromise(false);
            }
        }, (e) => {
            if (isNavigationCancelingError(e)) {
                this.navigated = true;
                this.resetStateAndUrl(storedState, storedUrl, rawUrl);
                (/** @type {?} */ (this.events))
                    .next(new NavigationCancel(id, this.serializeUrl(url), e.message));
                resolvePromise(false);
            }
            else {
                this.resetStateAndUrl(storedState, storedUrl, rawUrl);
                (/** @type {?} */ (this.events))
                    .next(new NavigationError(id, this.serializeUrl(url), e));
                try {
                    resolvePromise(this.errorHandler(e));
                }
                catch (/** @type {?} */ ee) {
                    rejectPromise(ee);
                }
            }
        });
    }
/**
     * Performs the logic of activating routes. This is a synchronous process by default. While this
     * is a private method, it could be overridden to make activation asynchronous.
     * @param {?} state
     * @param {?} storedState
     * @param {?} storedUrl
     * @param {?} id
     * @param {?} url
     * @param {?} rawUrl
     * @param {?} skipLocationChange
     * @param {?} replaceUrl
     * @param {?} resolvePromise
     * @param {?} rejectPromise
     * @return {?}
     */
Performs the logic of activating routes. This is a synchronous process by default. While this
is a private method, it could be overridden to make activation asynchronous.
Performs the logic of activating routes . This is a synchronous process by default . While this is a private method it could be overridden to make activation asynchronous .
activateRoutes(state, storedState, storedUrl, id, url, rawUrl, skipLocationChange, replaceUrl, resolvePromise, rejectPromise) {
        let  navigationIsSuccessful;
        state
            .forEach((p) => {
            if (typeof p === 'boolean' || !p.shouldActivate || id !== this.navigationId || !p.state) {
                navigationIsSuccessful = false;
                return;
            }
            const { appliedUrl, state } = p;
            this.currentUrlTree = appliedUrl;
            this.rawUrlTree = this.urlHandlingStrategy.merge(this.currentUrlTree, rawUrl);
            ( (this)).routerState = state;
            if (!skipLocationChange) {
                const  path = this.urlSerializer.serialize(this.rawUrlTree);
                if (this.location.isCurrentPathEqualTo(path) || replaceUrl) {
                    this.location.replaceState(path, '', { navigationId: id });
                }
                else {
                    this.location.go(path, '', { navigationId: id });
                }
            }
            new ActivateRoutes(this.routeReuseStrategy, state, storedState, (evt) => this.triggerEvent(evt))
                .activate(this.rootContexts);
            navigationIsSuccessful = true;
        })
            .then(() => {
            if (navigationIsSuccessful) {
                this.navigated = true;
                this.lastSuccessfulId = id;
                ( (this.events))
                    .next(new NavigationEnd(id, this.serializeUrl(url), this.serializeUrl(this.currentUrlTree)));
                resolvePromise(true);
            }
            else {
                this.resetUrlToCurrentUrlTree();
                ( (this.events))
                    .next(new NavigationCancel(id, this.serializeUrl(url), ''));
                resolvePromise(false);
            }
        }, (e) => {
            if (isNavigationCancelingError(e)) {
                this.navigated = true;
                this.resetStateAndUrl(storedState, storedUrl, rawUrl);
                ( (this.events))
                    .next(new NavigationCancel(id, this.serializeUrl(url), e.message));
                resolvePromise(false);
            }
            else {
                this.resetStateAndUrl(storedState, storedUrl, rawUrl);
                ( (this.events))
                    .next(new NavigationError(id, this.serializeUrl(url), e));
                try {
                    resolvePromise(this.errorHandler(e));
                }
                catch ( ee) {
                    rejectPromise(ee);
                }
            }
        });
    }
activateRoutes ( state , storedState , storedUrl , id , url , rawUrl , skipLocationChange , replaceUrl , resolvePromise , rejectPromise ) { let navigationIsSuccessful ; state . forEach ( ( p ) => { if ( typeof p === 'boolean' || ! p . shouldActivate || id !== this . navigationId || ! p . state ) { navigationIsSuccessful = false ; return ; } const { appliedUrl , state } = p ; this . currentUrlTree = appliedUrl ; this . rawUrlTree = this . urlHandlingStrategy . merge ( this . currentUrlTree , rawUrl ) ; ( ( this ) ) . routerState = state ; if ( ! skipLocationChange ) { const path = this . urlSerializer . serialize ( this . rawUrlTree ) ; if ( this . location . isCurrentPathEqualTo ( path ) || replaceUrl ) { this . location . replaceState ( path , '' , { navigationId : id } ) ; } else { this . location . go ( path , '' , { navigationId : id } ) ; } } new ActivateRoutes ( this . routeReuseStrategy , state , storedState , ( evt ) => this . triggerEvent ( evt ) ) . activate ( this . rootContexts ) ; navigationIsSuccessful = true ; } ) . then ( ( ) => { if ( navigationIsSuccessful ) { this . navigated = true ; this . lastSuccessfulId = id ; ( ( this . events ) ) . next ( new NavigationEnd ( id , this . serializeUrl ( url ) , this . serializeUrl ( this . currentUrlTree ) ) ) ; resolvePromise ( true ) ; } else { this . resetUrlToCurrentUrlTree ( ) ; ( ( this . events ) ) . next ( new NavigationCancel ( id , this . serializeUrl ( url ) , '' ) ) ; resolvePromise ( false ) ; } } , ( e ) => { if ( isNavigationCancelingError ( e ) ) { this . navigated = true ; this . resetStateAndUrl ( storedState , storedUrl , rawUrl ) ; ( ( this . events ) ) . next ( new NavigationCancel ( id , this . serializeUrl ( url ) , e . message ) ) ; resolvePromise ( false ) ; } else { this . resetStateAndUrl ( storedState , storedUrl , rawUrl ) ; ( ( this . events ) ) . next ( new NavigationError ( id , this . serializeUrl ( url ) , e ) ) ; try { resolvePromise ( this . errorHandler ( e ) ) ; } catch ( ee ) { rejectPromise ( ee ) ; } } } ) ; }
Performs the logic of activating routes.
Performs the logic of activating routes .
// applied the new router state // this operation has side effects /** @type {?} */ /** @type {?} */ /** @type {?} */ /** @type {?} */ /** @type {?} */ /** @type {?} */ /** @type {?} */ /** @type {?} */