fix(router): check if windows.console exists before using it (#12348)
This commit is contained in:

committed by
Victor Berchet

parent
752edca81b
commit
7886561997
@ -0,0 +1,10 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {__platform_browser_private__ as r} from '@angular/platform-browser';
|
||||
|
||||
export var getDOM: typeof r.getDOM = r.getDOM;
|
@ -8,10 +8,12 @@
|
||||
|
||||
import {APP_BASE_HREF, HashLocationStrategy, Location, LocationStrategy, PathLocationStrategy, PlatformLocation} from '@angular/common';
|
||||
import {ANALYZE_FOR_ENTRY_COMPONENTS, APP_BOOTSTRAP_LISTENER, ApplicationRef, Compiler, Inject, Injector, ModuleWithProviders, NgModule, NgModuleFactoryLoader, OpaqueToken, Optional, Provider, SkipSelf, SystemJsNgModuleLoader} from '@angular/core';
|
||||
|
||||
import {Route, Routes} from './config';
|
||||
import {RouterLink, RouterLinkWithHref} from './directives/router_link';
|
||||
import {RouterLinkActive} from './directives/router_link_active';
|
||||
import {RouterOutlet} from './directives/router_outlet';
|
||||
import {getDOM} from './private_import_platform-browser';
|
||||
import {ErrorHandler, Router} from './router';
|
||||
import {ROUTES} from './router_config_loader';
|
||||
import {RouterOutletMap} from './router_outlet_map';
|
||||
@ -22,7 +24,6 @@ import {DefaultUrlSerializer, UrlSerializer} from './url_tree';
|
||||
import {flatten} from './utils/collection';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @whatItDoes Contains a list of directives
|
||||
* @stable
|
||||
@ -249,11 +250,12 @@ export function setupRouter(
|
||||
}
|
||||
|
||||
if (opts.enableTracing) {
|
||||
const dom = getDOM();
|
||||
router.events.subscribe(e => {
|
||||
console.group(`Router Event: ${(<any>e.constructor).name}`);
|
||||
console.log(e.toString());
|
||||
console.log(e);
|
||||
console.groupEnd();
|
||||
dom.logGroup(`Router Event: ${(<any>e.constructor).name}`);
|
||||
dom.log(e.toString());
|
||||
dom.log(e);
|
||||
dom.logGroupEnd();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
"outDir": "../../../dist/packages-dist/router",
|
||||
"paths": {
|
||||
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"],
|
||||
"@angular/router": ["../../../dist/packages-dist/router"],
|
||||
"@angular/upgrade/static": ["../../../dist/packages-dist/upgrade/static"]
|
||||
},
|
||||
|
Reference in New Issue
Block a user