Angular 4 路由适用于我,但不适用于我的团队
Angular 4 Routing works for me, but not my team
问题 - 路由对我来说工作正常。当我转到 localhost/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 });
尝试改变
{ path: '', component: DashboardComponent }
至 { path: '', component: DashboardComponent, pathMatch: 'full' }
看来问题是因为 case-sensitive 而我不知道?
我使用路径http://localhost:56110/filecabinet
他们使用路径 http://localhost:56110/FileCabinet
问题 - 路由对我来说工作正常。当我转到 localhost/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 });
尝试改变
{ path: '', component: DashboardComponent }
至 { path: '', component: DashboardComponent, pathMatch: 'full' }
看来问题是因为 case-sensitive 而我不知道?
我使用路径http://localhost:56110/filecabinet 他们使用路径 http://localhost:56110/FileCabinet