Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 759 Bytes

File metadata and controls

25 lines (18 loc) · 759 Bytes

path method

FlowRouter.path(path, params, queryParams);
  • path {String} - Path or Route's name
  • params {Object} - Serialized route parameters, { _id: 'str' }
  • queryParams {Object} - Query params object, { key: 'val' }
  • Returns {String} - URI
const pathDef = '/blog/:cat/:id';
const params = { cat: 'met eor', id: 'abc' };
const queryParams = {show: 'y+e=s', color: 'black'};

const path = FlowRouter.path(pathDef, params, queryParams);
console.log(path); // --> "/blog/met%20eor/abc?show=y%2Be%3Ds&color=black"

If there are no params or queryParams, it will simply return the path as it is.

Further reading