Constructor
new AvenxRouter(app, routes)
Parameters:
| Name | Type | Description |
|---|---|---|
app |
AvenxApp | The main application instance. |
routes |
Object.<string, (string|Object)> | A map of hash routes to page names or route definitions. |
- Source:
Classes
Members
app :AvenxApp
Type:
- Source:
currentRoute :Object|null
Type:
- Object | null
- Source:
hashToIgnore :string|null
@private
Type:
- string | null
- Source:
routes :Object.<string, (string|Object)>
Type:
- Object.<string, (string|Object)>
- Source:
Methods
destroy()
Destroys the router and cleans up event listeners.
- Source:
navigate(hash)
Navigates to a specific hash route.
Parameters:
| Name | Type | Description |
|---|---|---|
hash |
string | The target hash (e.g., '#/about'). |
- Source:
start()
Starts the router and handles the initial route.
- Source: