Skip to content

hwclass/capsule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##capsule.js

This attitude is a modular javascript architechture boilerplate. This is a small library initializing code for dynamic views.

###Usage

  /*Context : testModule*/

  app.define('testModule', {

    /**
     * config{} contains configuration properties.
     *
    */
    config : {
      title : 'View Title'
    },

    /**
     * models{} contains module-specific model structures.
     *
    */
    models : [],

    /**
     * el{} wraps the elements living in the context of current module.
     *
    */
    el : {
      container : document.querySelector('body')
    },

    /**
     * fn{} is used to reach module specific methods / functions.
     *
    */
    fn : {},

    /**
     * getInstance() returns the current context.
     *
    */
    getInstance : function () {
      return this;
    },
    
    /**
     * init() stars the current module.
     *
    */
    init : function () {
      app.subscribe('customEventForBaseTestData', function(args) {
        console.log(args);
      });
    }

  });

About

Modular javascript architechture boilerplate

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published