@version 0.1.2
@date 2015-02-02
@stability 1 - Experimental
LiteJS
Lite framework for building single-page applications.
Views
Organize views into a hierarchy with built-in router.
Api
View(name, element, parent, contentSelector)
- name
String
- A name for a view that is also a route to the view.
Accepts Level 1 URI Templates RFC 6570 - element
String
or Function
or DOM Node
-
View representation as DOM tree.
String and Function will be transformed to DOM Node on first call. - parent
String
- Parent view name. - contentSelector
String, optional
- A selector to where a child Node will be attached.
How to use
// Optional path for views, default = ""
View.base = "/js/views/"
// Define starting point in DOM
View("body", document.body)
// Create first simple view
View("home", ".home", "body")
// Create another view
View("work", ".work", "body")
// Start
View.main = "home"
history.start(View.route)
// call manualy
View("home").show()
External links
Licence
Copyright (c) 2013-2015 Lauri Rooden <lauri@rooden.ee>
The MIT License