Skip to content

devoralive/doa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub version Code Climate Build Status Test Coverage

##Use doa

Object declaration :

define({
    /* private param declaration */
    param: 'this param is private',

    /* public param declaration */
    public: {
        publicParam: 'this param is public'
    },

    /* object constructor */
    construct: function (some, params) {

    },

    /* add accessor for your param */
    getParam: function () {
        return this.param;
    },

    setParam: function (param) {
        this.param = param;
    }
});

Object requirement :

require(['doa!class:your/object'], function (YourObject) {
    var myObjectInstance = new YourObject('contruct', 'params');
});

Interface:

define(['doa!implement:your/interface'], {
    /* object implementing your/interface */
});

Extend:

/**
 * Parent class
 */
define({
    param: '',

    setParentParam: function () {
        return this.param;
    }
});
/**
 * Class that extend the abstract class
 */
define(['doa!extend:your/parent'], {
    getParentParam: function () {
        return this.parent.param;
    }
});

Trait:

define(['doa!trait:your/trait'], {
});

###Project installation :

Install nodejs and npm

http://nodejs.org/

Install grunt-cli and bower

npm install -g grunt-cli bower

Install node dependencies

npm install --save-dev

Download bower dependenies

bower install --dev

###Grunt commands : Checking the code

grunt test

Run only the test with coverage

grunt jasmine:coverage

the default jasmine action doesn't work actualy, use only coverage action

About

JavaScript class library based on requirejs

Resources

Stars

Watchers

Forks

Packages

No packages published