"use strict"; angular.module('app.service') .factory('BaseBridge', ['$q', 'AbstractBridge', function ($q, AbstractBridge) { var BaseBridge = function (controller) { AbstractBridge.apply(this, arguments); }; BaseBridge.prototype = _.create(AbstractBridge.prototype); BaseBridge.prototype.constructor = BaseBridge; /** * @param {{pagination: Object=, filter: Object=}} [request] * @returns {promise} */ BaseBridge.prototype.list = function (request) { return this.post('list', request); }; /** * Create new object, and read its data * @returns {promise} */ BaseBridge.prototype.create = function () { return this.post('create'); }; /** * Read object data * @param id * @returns {promise} */ BaseBridge.prototype.read = function (id) { return this.post('view', {id: id}); }; /** * Save object data * @param {Object} data * @returns {promise} */ BaseBridge.prototype.save = function (data) { return this.post('save', data); }; /** * Remove object * @param {Number} id * @returns {promise} */ BaseBridge.prototype.remove = function (id) { return this.post('delete', {id: id}); }; return BaseBridge; }]);