Class: AvenxRouter

AvenxRouter(app, routes)

AvenxRouter handles hash-based routing for the application. It maps URL hashes to specific Page components.

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

AvenxRouter

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:

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: