Answers for "how create routes with parameter angular"

0

pass parameter in route angular

//pass params

this.router.navigate([`admin/showProduct/${catKey}/${subcat_key}/${key}`])

//get params 

  constructor(  private route:ActivatedRoute ) {
  
    this.catkey =this.route.snapshot.paramMap.get('catkey');
  }
Posted by: Guest on April-09-2022
0

route with parameters angular

//app-routing.module.ts file  register path like this
{
   path:'showProduct/:param1/:param2',component:ShowProductComponent
   }
Posted by: Guest on April-09-2022

Code answers related to "TypeScript"

Browse Popular Code Answers by Language