Modulor router
- router
- ~Route
- .getRouter()
- .getPath() ⇒
String
- .getParams() ⇒
Object
- .routeMatches() ⇒
Boolean
- .getGlobalPath() ⇒
String
- .resolve()
- ~Router
- .handleRouteChange()
- .isRouter($el) ⇒
Boolean
- .getChildRouters() ⇒
Array.<HTMLElement>
- .resolve()
- .getRootRouter() ⇒
HTMLElement
- .getRoot() ⇒
String
- .getQs() ⇒
String
- .getParams() ⇒
Object
- .setParams(queryParams, navigationParams)
- .updateParams(queryParams, navigationParams)
- .useHash() ⇒
Boolean
- .getGlobalPath() ⇒
String
- .getPath() ⇒
String
- .rootMatches() ⇒
Boolean
- .add(path, callback)
- .navigate(path, params)
- .getRoutes() ⇒
Array.<Route>
- .mount(path, router)
- .unmount(router)
- .destroy()
- ~NavigationParams :
Object
- ~Route
Kind: inner class of router
- ~Route
- .getRouter()
- .getPath() ⇒
String
- .getParams() ⇒
Object
- .routeMatches() ⇒
Boolean
- .getGlobalPath() ⇒
String
- .resolve()
Get router instance
Kind: instance method of Route
Kind: instance method of Route
Returns: String
- Relative path (global path without router base)
Kind: instance method of Route
Returns: Object
- URL query parameters
Indicates if route matches path
Kind: instance method of Route
Kind: instance method of Route
Returns: String
- Global path
Resolves route
Kind: instance method of Route
Kind: inner class of router
- ~Router
- .handleRouteChange()
- .isRouter($el) ⇒
Boolean
- .getChildRouters() ⇒
Array.<HTMLElement>
- .resolve()
- .getRootRouter() ⇒
HTMLElement
- .getRoot() ⇒
String
- .getQs() ⇒
String
- .getParams() ⇒
Object
- .setParams(queryParams, navigationParams)
- .updateParams(queryParams, navigationParams)
- .useHash() ⇒
Boolean
- .getGlobalPath() ⇒
String
- .getPath() ⇒
String
- .rootMatches() ⇒
Boolean
- .add(path, callback)
- .navigate(path, params)
- .getRoutes() ⇒
Array.<Route>
- .mount(path, router)
- .unmount(router)
- .destroy()
Kind: instance method of Router
Indicates if element is router node
Kind: instance method of Router
Param | Type |
---|---|
$el | HTMLElement |
Kind: instance method of Router
Returns: Array.<HTMLElement>
- Child router nodes
Resolves router
Kind: instance method of Router
Kind: instance method of Router
Returns: HTMLElement
- Root router
Kind: instance method of Router
Returns: String
- Path base
Kind: instance method of Router
Returns: String
- URL query string
Kind: instance method of Router
Returns: Object
- URL query parameters
Set new query parameters. Leave only provided parameters in query string
Kind: instance method of Router
Param | Type | Description |
---|---|---|
queryParams | Object |
URL query parameters |
navigationParams | NavigationParams |
Navigation params |
Update query parameters. Overwrite if param exists, add if not
Kind: instance method of Router
Param | Type | Description |
---|---|---|
queryParams | Object |
URL query parameters |
navigationParams | NavigationParams |
Navigation params |
Indicates if router uses hashbang
Kind: instance method of Router
Kind: instance method of Router
Returns: String
- Global path
Kind: instance method of Router
Returns: String
- Relative path (global path without router base)
Indicates if router base matches current path
Kind: instance method of Router
Add route
Kind: instance method of Router
Param | Type | Description |
---|---|---|
path | String |
Path |
callback | function |
Callback |
Navigate to path
Kind: instance method of Router
Param | Type | Description |
---|---|---|
path | String |
Path relative to router base |
params | NavigationParams |
Navigation params |
Get routes
Kind: instance method of Router
Mount another router on subpath of current one
Kind: instance method of Router
Param | Type | Description |
---|---|---|
path | String |
Path |
router | Router |
Router |
Unmount child router
Kind: instance method of Router
Param | Type | Description |
---|---|---|
router | Router |
Router |
Destroy router
Kind: instance method of Router
Kind: inner typedef of router
Properties
Name | Type | Default | Description |
---|---|---|---|
[absolute] | boolean |
false |
Use absolute path instead of relative by default |
[silent] | boolean |
false |
Do not resolve routers after navigation |
[replace] | boolean |
false |
Replace history state instead of push |
[noLeadingSlash] | boolean |
false |
Put slash before route to navigate to |