A lightweight, object-oriented JS framework for quickly creating clearly and structured web applications.
- basic objects type: HashMap, ArrayList, Model
- built-in objects: Module, Util, Config, Action, Dao, Class, View
- create objects
- run action
$ npm i armjs2
see npm: armjs2
example usage arm-example
Action -> View -> Class -> Dao -> Model
Module, defined module info
Action, control some Object and instancing Class, View
View, DOM process and Event bind
Class, JSON parse, and service logic
Dao, ajax request
Model, JSON object or Object-Class
Config, JSON object, module config
Util, JSON object, static method list
var Module = Arm.create('Module', {
name: 'Module',
SubModule: {}
});
Module.Action = Arm.create('Action', {
name: 'Module.Action'
});
Module.View = Arm.create('View', {
name: 'Module.View',
element: document,
properties: {
},
options: {
}
});
// XView
Module.XView = Arm.create('View', {
name: 'Module.XView',
element: document,
properties: {
},
options: {
}
});
// SubModule.View
Module.SubModule.XView = Arm.create('View', {
name: 'Module.SubModule.XView',
element: document,
properties: {
},
options: {
}
});
Module.Class = Arm.create('Class', {
name: 'Module.Class',
properties: {
},
options: {
}
});
// XClass
Module.XClass = Arm.create('Class', {
name: 'Module.XClass',
properties: {
},
options: {
}
});
// SubModule.XClass
SubModule.XClass = Arm.create('Class', {
name: 'SubModule.XClass',
properties: {
},
options: {
}
// hiherits from class
}).inherits(Module.XClass);
Module.Dao = Arm.create('Dao', {
name: 'Module.Dao',
getName: function(data, callback) {
// ajax
}
});
// XDao
Module.XDao = Arm.create('Dao', {
name: 'Module.XDao',
// don no extend from Base module
extendBase: false,
getName: function(data, callback) {
// ajax
}
});
// extends
Module.Action.get('Class').extend({});
// run view
Module.Action.run({});
// TODO:
tradition multi pages, such as struts of Java Web
also support one page, likes backbone
see demo and test, require jQuery, jQuery Tmpl, and Qunit
$ npm install
$ npm run build