README
jquery-modules
Simple modules plugin that gives your jQuery code structure you never had.
jQuery-modules features
- Shared service objects
- Encapsulated module jQuery root element as a container for all events and components
- Automatically cache component objects to module
- Define module actions available for events and module internal usage
- Define module events with automatic bind/unbind.
Usage
$(document).ready(function () {
$(document).module({
services: {
helpers: {
parseTaskName: function (name) {
// Do some parsing...
return name;
}
},
taskRepository: {
find: function (id) {},
list: function (params) {},
create: function (data) {},
update: function (task) {},
delete: function (task) {}
}
}
})
$("#app").module({
init: function () {
// Do your module initialization magic here... :)
},
// Search for all jQuery objects in module root and store the to the module object.
// All components will be stored in the module object with "