2017-07-17 49 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 }) 
相關問題