A tiny foundation that providing nested state-based routing for complex web application.
A tiny foundation that providing nested state-based routing for complex web application.
stateman: A tiny foundation that provides nested state-based routing for complex web applications.
stateman is highly inspired by ui-router; you will find many features similar to it.
But stateman is a standalone library with an extremely tiny codebase (5kb minified). Feel free to integrate it with whatever framework you like!
You may need a static server to run the demo. puer is simple to get start.
just paste the code to your own index.html, and load it up in a browser.
StateMan Test
/home"
/contact"
/contact/list
/contact/2
/contact/2/option
/contact/2/message
open the console to see the output when navigating.
###1. Simple Layout Demo:
The code in this demo is for demonstration only. In a production development, you will want a view layer to create nested views.
###2. A simple SPA built upon Regularjs (Living Template) + requirejs + stateman: Link
I create a simple wrapping (regular-state) to integrate stateman with Regularjs, which makes it easy to build a single Page Application. thanks to the concise API, the code is very clean. You will find that integrating stateman with other libraries is also simple.
bower install statemanstateman.js have been packaged as a standard UMD, so you can use it in AMD, CommonJS and as a global.
npm install statemanTo use:
var StateMan = require('stateman');spm install statemanTo use:
var StateMan = require('stateman');component install leeluolee/statemanTo use:
var StateMan = require('leeluolee/stateman');Some basic examples can be found in the examples directory.
run demo local
npm install gulp -g && npm installgulp serverMIT.
No open issues yet, or sync has not completed.