ZLIQ-Router
ZLIQ
Router for the light zliq-framework.
Quickstart
To use ZLIQ in your project, first install it as an dependency:
$ npm install --save zliq zliq-router
Then initialize the router which hooks into document events
;; let router$ = let app = <div> <a href="/route?param=value#anchor" /> </div>;document; // Will be '/route {param: 'value'} anchor after click on linkrouter$
To route you could switch on route values.
let router$ = let app = <div> <a href="/route?param=value#anchor" /> if ) </div>;document;
Or you use the Router component. The component also registers its route so we can fallback to '/' on missing route. We can also add a '/404' route that gets triggered on a missing route if available.
let router$ = let app = <div> <a href="/route?param=value#anchor" /> <Router router$=router$ route='/'> <h1>Titel</h1> </Router> <Router router$=router$ route='/route'> <h1>Subpage</h1> </Router> </div>;document;
Logo based on: http://www.iconsfind.com/2015/11/25/candy-dessert-food-sweet-baby-icon/