Abstract.js is a web framework for fast development
MIT License
Abstract.js is a new and amazing framework for fast web development. It's the world's first Logic Oriented Program Framework(As I know). Using Abstract.js you can construct a readable, tidy project.
##Doc Doc
##examples simple render model
var nav = new RenderModel({
el: '.nav',
data: {
navList: [
{name: '简介', cn: '_intro'},
{name: '应用', cn: '_applacation'},
{name: '文档', cn: '_doc'}
]
},
tmpl: "<li soda-repeat='item in navList' onclick='switchNav(\"{{item.cn}}\")' class='{{item.cn}}'>{{item.name}}</li>",
events: function(){
window.switchNav = function(name){
Model.trigger("." + name);
};
}
});
nav.rock();
page model
var intro = new RenderModel({
el: '.intro',
tmpl: 'Model.js'
});
var nav = new RenderModel({
el: '.nav',
data: {
navList: [
{name: '简介', cn: '_intro'},
{name: '应用', cn: '_applacation'},
{name: '文档', cn: '_doc'}
]
},
tmpl: "<li soda-repeat='item in navList' onclick='switchNav(\"{{item.cn}}\")' class='{{item.cn}}'>{{item.name}}</li>",
events: function(){
window.switchNav = function(name){
Model.trigger("." + name);
};
}
});
var page = new PageModel();
page.add(intro);
page.add(nav);
page.rock();
observe events
var intro = new RenderModel({
el: '.intro',
tmpl: 'Model.js'
});
intro.addEventListener("completed", function(e){
// do something
});
###Learn Abstract.js(comming soon)