src/controller.js
function saveItemController(method, path) {
    restController.call(this, method, path);
    var ctrl = this;

    /**
     * Save item controller use this method to output a service as a rest
     * service
     * Output the saved document with the $outcome property
     *
     * @param {apiService} service
     * @param {object} [moreparams] optional additional parameters to give to the service
     *
     * @return {Promise}
     */
    this.jsonService = function(service, moreparams) {

        var params = ctrl.getServiceParameters(ctrl.req);

        var promise = service.getResultPromise(params);

        ctrl.outputJsonFromPromise(service, promise);

        return promise;
    };
}
function saveItemController(method, path) {
    restController.call(this, method, path);
    var ctrl = this;

    /**
     * Save item controller use this method to output a service as a rest
     * service
     * Output the saved document with the $outcome property
     *
     * @param {apiService} service
     * @param {object} [moreparams] optional additional parameters to give to the service
     *
     * @return {Promise}
     */
    this.jsonService = function(service, moreparams) {

        var params = ctrl.getServiceParameters(ctrl.req);

        var promise = service.getResultPromise(params);

        ctrl.outputJsonFromPromise(service, promise);

        return promise;
    };
}
function saveItemController ( method , path ) { restController . call ( this , method , path ) ; var ctrl = this ; /**
     * Save item controller use this method to output a service as a rest
     * service
     * Output the saved document with the $outcome property
     *
     * @param {apiService} service
     * @param {object} [moreparams] optional additional parameters to give to the service
     *
     * @return {Promise}
     */ this . jsonService = function ( service , moreparams ) { var params = ctrl . getServiceParameters ( ctrl . req ) ; var promise = service . getResultPromise ( params ) ; ctrl . outputJsonFromPromise ( service , promise ) ; return promise ; } ; }
Base class for create or update an item

@param {string} method   post|put
@param {string} path
Base class for create or update an item