lib/transformers/ng.apiclient.transformer.js
function getTemplateModel(prefix, resource, appName) {
    var methods = {};

    // if no api or browser apiclient, then return null since we will skip
    if (!resource.api || resource.adapters.browser !== 'apiclient') {
        return null;
    }

    // loop through API routes and create method objects for the template
    _.each(resource.api, function (urlMappings, httpMethod) {
        _.each(urlMappings, function (methodName, url) {
            methods[methodName] = {
                httpMethod: httpMethod,
                url: url
            };
        });
    });

    return {
        resourceName:   resource.name,
        appName:        this.getAppModuleName(prefix, appName),
        serviceName:    this.pancakes.utils.getCamelCase(resource.name + '.service'),
        modelName:      this.pancakes.utils.getPascalCase(resource.name),
        methods:        JSON.stringify(methods)
    };
}
function getTemplateModel(prefix, resource, appName) {
    var methods = {};

    // if no api or browser apiclient, then return null since we will skip
    if (!resource.api || resource.adapters.browser !== 'apiclient') {
        return null;
    }

    // loop through API routes and create method objects for the template
    _.each(resource.api, function (urlMappings, httpMethod) {
        _.each(urlMappings, function (methodName, url) {
            methods[methodName] = {
                httpMethod: httpMethod,
                url: url
            };
        });
    });

    return {
        resourceName:   resource.name,
        appName:        this.getAppModuleName(prefix, appName),
        serviceName:    this.pancakes.utils.getCamelCase(resource.name + '.service'),
        modelName:      this.pancakes.utils.getPascalCase(resource.name),
        methods:        JSON.stringify(methods)
    };
}
function getTemplateModel ( prefix , resource , appName ) { var methods = { } ; // if no api or browser apiclient, then return null since we will skip if ( ! resource . api || resource . adapters . browser !== 'apiclient' ) { return null ; } // loop through API routes and create method objects for the template _ . each ( resource . api , function ( urlMappings , httpMethod ) { _ . each ( urlMappings , function ( methodName , url ) { methods [ methodName ] = { httpMethod : httpMethod , url : url } ; } ) ; } ) ; return { resourceName : resource . name , appName : this . getAppModuleName ( prefix , appName ) , serviceName : this . pancakes . utils . getCamelCase ( resource . name + '.service' ) , modelName : this . pancakes . utils . getPascalCase ( resource . name ) , methods : JSON . stringify ( methods ) } ; }
Get the template model for an API Client
@param prefix
@param resource
@param appName
@returns {*}
Get the template model for an API Client