Retrieve a route object by id or url, while taking metadata passed into account
Parameter Name | Type | Description |
---|---|---|
id | String | Can be a route id or a generated route url |
metadata | Object | Pass the parameters for the route and / or query string object. params Object query Object |
strict | Boolean | If false the builder will return a route registered with notFound as true. |
var router = fluxapp.getRouter();
var route = router.getRoute('user-list', {
method: 'POST'
});
route.id // user-list
var route = router.getRoute('/users/list', {
method: 'POST'
});
route.id // user-list
var route = router.getRoute('/users/list-typo', {
method: 'POST'
}, false);
route.notFound // true (if a not found route was registered)
On to Dispatcher