Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
problem
How to use = on route in place of / routing angular 7 ?

i need to replace id/50 as example by id=50 on URL routing

What I have tried:

on app.module.ts routing
  {path:'order',children:[
    {path:'',component:OrderComponent},  
    {path:'edit/:id',component:OrderComponent}
  ]} 
]

order.component.ts
 ngOnInit() {
 
    let orderID = this.currentRoute.snapshot.paramMap.get('id');
}

i need to replace order/edit/50 with order/edit/id=50
Posted
Updated 23-Dec-19 22:07pm
Comments
ZurdoDev 18-Dec-19 7:33am    
You could just check the query string and not mess with the routes.
ahmed_sa 18-Dec-19 8:51am    
can you give me any example

1 solution

Angular[^]

If you follow the example given in the link above, it is default for using the route parameters without specifying the = sign.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900