Angular 4 Routing对我有用,但不适合我的团队

时间:2018-04-10 14:18:42

标签: angular angular2-routing

问题 - 路由对我来说很好。当我转到localhost / filecabinet时,会转到我的filecabinet组件。正如它应该。但是,我已将我的代码检查到源代码管理中。我的团队获取代码并转到相同的路径,并将它们带到仪表板组件。好像它找不到路线?

所以我真的很茫然。好像我还没有将文件检查到他们可能需要的源代码控制中?我真的不知道。有什么想法吗?希望我还有更多的事情要继续,但我感到很困惑?

这是我的app.routing.ts文件:

import { Routes, RouterModule } from '@angular/router';
import { DashboardComponent } from './Dashboard/dashboard.component';
import { FileCabinetComponent } from './File-Cabinet/file- 
cabinet.component';
import { FileUploadComponent } from './File-Cabinet/file-upload.component';

export const routing = RouterModule.forRoot([
{ path: '', component: DashboardComponent },
{ path: 'dashboard', component: DashboardComponent },
{ path: 'filecabinet', component: FileCabinetComponent },
{ path: 'filecabinet/add', component: FileUploadComponent },
{ path: 'filecabinet/edit/:id', component: FileUploadComponent },
{ path: '**', component: DashboardComponent },
]);
//], { enableTracing: true });

2 个答案:

答案 0 :(得分:0)

尝试改变 { path: '', component: DashboardComponent }{ path: '', component: DashboardComponent, pathMatch: 'full' }

答案 1 :(得分:0)

问题似乎是因为它区分大小写,我不知道呢?

我使用路径http://localhost:56110/filecabinet 他们使用路径http://localhost:56110/FileCabinet