You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I'm just creating a small app embedded in a website (i.e. a "Chat with us" box in a corner or something), I don't want it to be represented in URL, but I still need the functionality of routes.
Would a transparent m.route.mode be possible? I'd event say it should be the default :)
Or did I missed something in docs?
The text was updated successfully, but these errors were encountered:
You can add an object to hold your routes like this:
//routes to point to said modulesapp.routes={"foo": app.module1,"bar": app.module2};
Then you can create a "redirect" method to call programmatically:
//utility to programmatically routeapp.route=function(route){m.module(rootElement,app.routes[route])}//usage:app.route("foo")//runs module1
And, optionally, you can create a helper tool to make links routed also
//utility to make links routeableapp.router=function(element,isInit){if(!isInit){m.module(rootElement,app.routes[element.href])}}//usage:m("a[href=foo]",{config: app.router})
If I'm just creating a small app embedded in a website (i.e. a "Chat with us" box in a corner or something), I don't want it to be represented in URL, but I still need the functionality of routes.
Would a transparent
m.route.mode
be possible? I'd event say it should be the default :)Or did I missed something in docs?
The text was updated successfully, but these errors were encountered: