Skip to content

Latest commit

 

History

History
106 lines (85 loc) · 2.07 KB

File metadata and controls

106 lines (85 loc) · 2.07 KB

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