Use Knockout with abstract-state-router!
- Hackers News http://crissdev.github.io/hn-ko-asr/
var StateRouter = require('abstract-state-router')
var knockoutRenderer = require('knockout-state-renderer')
var domready = require('domready')
var stateRouter = StateRouter(knockoutRenderer(/* options */), 'body')
// add whatever states to the state router
domready(function() {
stateRouter.evaluateCurrentRoute('login')
})
See state-router-example for an implementation using this renderer.
The renderer implementation accepts some options to control data binding inside the templates.
An alias used when the binding context is created, accessible inside the templates. The default value
is $page
.
The CSS selector used to find the element where the child state should be rendered. The default value
is ui-view
.