Router#

new Router(routes)#

Represents a Router to load a route
Parameters:
NameTypeDescription
routesObjectThe routes of the app
Example
CODE
const myRouter = new Router(routes);

Methods#

init() → {void}#

Init the router to get the current path and load the cooresponding view
Returns:
Type: 
void

(async) loadRoute(pathName) → {void}#

Load the corresponding view according to the pathName given
Parameters:
NameTypeDescription
pathNamerouteThe name of the path to load
Returns:
Type: 
void