lib/factories/model.factory.js
function create(modulePath, moduleStack) {

        // first check the cache to see if we already loaded it
        if (this.cache[modulePath]) {
            return this.cache[modulePath];
        }

        // try to get the resource for this module
        var resource;
        if (this.resources[modulePath]) {
            resource = this.resources[modulePath];
        }
        else if (this.resourceNames[modulePath]) {
            resource = this.injector.loadModule(this.resourceNames[modulePath] + 'Resource');
        }
        else {
            return null;
        }

        // get the service for this model
        var serviceName = modulePath.substring(0, 1).toLowerCase() + modulePath.substring(1) + 'Service';
        var service = this.injector.loadModule(serviceName, moduleStack);

        // save the model to cache and return it
        var Model = this.getModel(service, resource.mixins);
        this.cache[modulePath] = Model;
        return Model;
    }
function create(modulePath, moduleStack) {

        // first check the cache to see if we already loaded it
        if (this.cache[modulePath]) {
            return this.cache[modulePath];
        }

        // try to get the resource for this module
        var resource;
        if (this.resources[modulePath]) {
            resource = this.resources[modulePath];
        }
        else if (this.resourceNames[modulePath]) {
            resource = this.injector.loadModule(this.resourceNames[modulePath] + 'Resource');
        }
        else {
            return null;
        }

        // get the service for this model
        var serviceName = modulePath.substring(0, 1).toLowerCase() + modulePath.substring(1) + 'Service';
        var service = this.injector.loadModule(serviceName, moduleStack);

        // save the model to cache and return it
        var Model = this.getModel(service, resource.mixins);
        this.cache[modulePath] = Model;
        return Model;
    }
function create ( modulePath , moduleStack ) { // first check the cache to see if we already loaded it if ( this . cache [ modulePath ] ) { return this . cache [ modulePath ] ; } // try to get the resource for this module var resource ; if ( this . resources [ modulePath ] ) { resource = this . resources [ modulePath ] ; } else if ( this . resourceNames [ modulePath ] ) { resource = this . injector . loadModule ( this . resourceNames [ modulePath ] + 'Resource' ) ; } else { return null ; } // get the service for this model var serviceName = modulePath . substring ( 0 , 1 ) . toLowerCase ( ) + modulePath . substring ( 1 ) + 'Service' ; var service = this . injector . loadModule ( serviceName , moduleStack ) ; // save the model to cache and return it var Model = this . getModel ( service , resource . mixins ) ; this . cache [ modulePath ] = Model ; return Model ; }
Create a model
@param modulePath
@param moduleStack
Create a model