[SOLVED] Using params in router


I want to do something simular to this, bind params when routing.

routes: [
path: ‘/manage-company/’,
url: ‘manage-company.html?idc=:idc’,

mainView.router.navigate({url:’/manage-company/’, query: {idc: 18}});

What is the correct way to do this?

Passing dynamic parameters to a route

I use this

  path: '/pages/:entidad/listado',              // ej: href="/pages/frutas/listado"
  componentUrl: './pages/listados.html',
  options: {
    context: {
              entidad: '{{entidad}}',         // Envia por param: "frutas"


where :entidad is a parameter
and in your html, you can retrive it like this:


<div class="page listados page-{{$route.params.entidad}}" data-name="{{$route.params.entidad}}">

    <div class="navbar">


Yes but how do i use this in my example if i want router.navigate to route to specified URL?


this should be your route (try it please!)

  path: '/manage-company/:idc/',             
  componentUrl: './manage-company.html',
  options: {
    context: {
              idc: '{{idc}}',        


the “:idc” refers to a dynamic parameter

and to navigate:

            app.router.navigate("/manage-company/"+ idc + '/',{
                context: { idc: idc }


Great i will try that :slight_smile:


It’s not working:

Uncaught ReferenceError: idc is not defined


you should replace IDC with your local var o data.
As I see in the example of your first post, you put “18”


I got it working :slight_smile:

mainView.router.routes = [{
path: ‘/manage-company/:idc/’,
url: ‘manage-company.html?idc={{idc}}’




This is so simple, very handy and should be mention in documentation!