Можно ли сделать угловой префикс маршрута 7, как в laravel?
Route::group(['prefix' => 'v1'], function (){
Route::get('categories', 'Api\ApiCategoryController@listOfCategories');
});
В приведенном выше коде мой URL будет https://example.com/api/v1/categories. Как я могу сделать такой URL-адрес в angular 7?





Вы можете попробовать:
const parentModuleRoutes: Routes = [
{
path: 'parent-component', //<---- parent component declared here
component: PetParentComponent,
children: [ //<---- child components declared here
{
path:'child-one',
component: ChildOneComponent
},
{
path:'child-two',
component: ChildTwoComponent
},
{
path:'child-three',
component: ChildThreeComponent
},
{
path:'child-four',
component: ChildFourComponent
},
]
}
];
Надеюсь помочь вам ^_^
Должен ли я также установить родительский путь в routerLink, например
routerLink = "parent-component/child-one"?