angular - How to handle n number of parameter in Angular2/4 router? -


in application, there can n number of params in urln , can have optional following pattern too. example, urls can be

http://example.com/{param1}

http://example.com/{param1}/constant/{id}

http://example.com/{param1}/{param2}/constant/{id}

http://example.com/{param1}/{param2}

http://example.com/{param1}/{param2}/{param3}

http://example.com/{param1}/{param2}/{param3}/constant/{id}

etc

how construct routing module these kind of urls?

do mean so?

routermodule.forchild([   { path: 'api/whatever/:id1/', component: componentname}   { path: 'api/whatever/:id1/dosomething/:id2', component: componentname}   { path: 'api/whatever/:id1/:id2', component: componentname}   { path: 'api/whatever/:id1/:id2/dosomething/:id3/dosomemore', component: componentname} ]) 

Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -