Passing dynamic parameters to a route


#1

Hello,

How does one define a route that will accept dynamic parameters?

Example

My URL is this

/process-data/?service_id=86&payload[record_uuid]=83459484858&payload[record_date]=2017-02-08&payload[record_name]=My%20Order

And my route which I need to set to accept the URL above is this

{
	path: "/process-data/",
	async(routeTo, routeFrom, resolve, reject) 
	{
	  
		console.log(routeTo);
					  
	}
}

Any pointers?


#2

This post will help you: [SOLVED] Using params in router

And with Async, you can use that

{
    path: '/pages/:entidad/am/',                                                    // ej: href="/pages/frutas/am"
    async: function (routeTo, routeFrom, resolve, reject) {
        console.log(routeTo);

        resolve({
                componentUrl: "./pages/"+routeTo.params.entidad + "am.html",
              });
    },
  },