param
Get a route path from given data.
route.param(data)
Parameters
- object
{data}
:The data to populate the route with.
Returns
{String}
:
The route, with the data populated in it.
Parameterizes the raw JS object representation provided in data.
route.param({ type: "video", id: 5 });
// -> "type=video&id=5"
If a route matching the provided data is found, that URL is built from the data. Any remaining data is added at the end of the URL as & separated key/value parameters.
route("{type}/{id}");
route.param({ type: "video", id: 5 }) // -> "video/5"
route.param({ type: "video", id: 5, isNew: false })
// -> "video/5&isNew=false"