Closed satyasuman closed 12 years ago
Hi, yes, you can setup an empty router, then add your routes at a later time.
Just invoke the add() method of the router instance:
myrouter.add({
"#something": "bsHandler",
"#otherone": { events: "s,h", handler: "bsHandler2" }
}, handlerObj);
The array syntax is also supported (and preferred):
myrouter.add([
{ "#something": "handler" },
{ "#otherone": { events: "s,h", handler: "handler2" } }
], handlerObj);
Cheers, Andrea
Hi is it possible to initialize an empty router and then add routes to it?