在下面的路由路径中的app-routing.module.ts中:
const routes: Routes = [
{path: '', redirectTo: 'home', pathMatch: 'full' },
{path:'home',component: SelectComponent},
{path: 'myForm', component: FormComponentComponent}
];
路径 -
{path: 'myForm', component: FormComponentComponent}
不起作用,但如果您将 'myForm' 更改为 'myform',路线将按预期工作。
为什么资本的存在阻碍了运作的路线?
尝试:'localhost:4200/myForm'它不起作用,而'localhost:4200/myform'它工作完美!!