2017-07-17 56 views
0

我的浏览器控制台的屏幕截图中显示了我的Web应用程序中存在路由错误。我如何从这个错误日志中得知哪个文件和哪一行是这个调用?你可以看到你与路由发生如何从浏览器控制台日志中找到错误的来源?

enter image description here

+0

从F12调试器调试路由问题是不可能的。因此,请在[**最小,完整和可验证的示例**](http://stackoverflow.com/help/mcve)中发布所有**相关代码**(包括您的配置和路由)。 –

回答

1

的方法之一是启用路由跟踪。我在这里有一个例子:https://github.com/DeborahK/Angular-Routing

RouterModule.forRoot([ 
    { path: 'welcome', component: WelcomeComponent }, 
    { path: '', redirectTo: 'welcome', pathMatch: 'full' }, 
    { path: '**', component: PageNotFoundComponent } 
], { enableTracing: true }) 
相关问题