像laravel api一样路由前缀

时间:2019-02-19 06:30:21

标签: angular laravel routes

是否可以像laravel一样设置7号角的路由前缀?

 create trigger addMyTable
on myTable
after insert
as
insert into myTable2(myid,myName,myAge,gender)
select myid,myName,myAge,gender from inserted
go

create trigger deleteMyTable
on myTable
for delete
as
delete from myTable2 where myid in (select deleted.myid from deleted)
go


create trigger updateMyTable
on myTable
for update
as
begin
    delete from myTable2 where myid in (select deleted.myid from deleted)
    insert into myTable2(myid,myName,myAge,gender) select myid,myName,myAge,gender from inserted
end
go

在上面的代码中,我的网址是https://example.com/api/v1/categories。如何在angular 7中创建此类网址?

1 个答案:

答案 0 :(得分:0)

您可以尝试:

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
            },
        ]
    }
];

希望对您有所帮助^ _ ^