Sha256: c1e06944f9d1d70e7dbc126364f27b835a043cd5a4483a628567b458156d1cca

Contents?: true

Size: 795 Bytes

Versions: 32

Compression:

Stored size: 795 Bytes

Contents

!(angular => {
  'use strict';

  class ResourceFactory {

    constructor($resource) {
      this._defaultActions = {
        update: {
          method: 'PUT'
        },
        create: {
          method: 'POST'
        },
        show: {
          method: 'GET'
        },
        index:  {
          method: 'GET',
          isArray: true,
          responseType: 'json'
        },
        destroy: {
          method: 'DELETE'
        }
      };

      this._$resource = $resource;
    }

    make(path, parameters, actions = {}) {
      return this._$resource(path, parameters, _.merge(this._defaultActions, actions));
    }
  }

  ResourceFactory.$inject = ['$resource'];
  angular.module('modelGeneration.resourceFactory', []).service('ResourceFactory', ResourceFactory);

}(angular));

Version data entries

32 entries across 16 versions & 1 rubygems

Version Path
aleph_analytics-0.4.9.pre.dev public/assets/angular/services/model_generation/resource_factory.js-e8ce2f4be9383d885dbb965c8e425bab.es6
aleph_analytics-0.4.9.pre.dev app/assets/javascripts/angular/services/model_generation/resource_factory.js.es6
aleph_analytics-0.4.8 public/assets/angular/services/model_generation/resource_factory.js-e8ce2f4be9383d885dbb965c8e425bab.es6
aleph_analytics-0.4.8 app/assets/javascripts/angular/services/model_generation/resource_factory.js.es6
aleph_analytics-0.4.7 app/assets/javascripts/angular/services/model_generation/resource_factory.js.es6
aleph_analytics-0.4.7 public/assets/angular/services/model_generation/resource_factory.js-e8ce2f4be9383d885dbb965c8e425bab.es6
aleph_analytics-0.4.4 public/assets/angular/services/model_generation/resource_factory.js-e8ce2f4be9383d885dbb965c8e425bab.es6
aleph_analytics-0.4.4 app/assets/javascripts/angular/services/model_generation/resource_factory.js.es6
aleph_analytics-0.4.2 public/assets/angular/services/model_generation/resource_factory.js-e8ce2f4be9383d885dbb965c8e425bab.es6
aleph_analytics-0.4.2 app/assets/javascripts/angular/services/model_generation/resource_factory.js.es6
aleph_analytics-0.4.1 public/assets/angular/services/model_generation/resource_factory.js-e8ce2f4be9383d885dbb965c8e425bab.es6
aleph_analytics-0.4.1 app/assets/javascripts/angular/services/model_generation/resource_factory.js.es6
aleph_analytics-0.3.0 public/assets/angular/services/model_generation/resource_factory.js-e8ce2f4be9383d885dbb965c8e425bab.es6
aleph_analytics-0.3.0 app/assets/javascripts/angular/services/model_generation/resource_factory.js.es6
aleph_analytics-0.2.0 app/assets/javascripts/angular/services/model_generation/resource_factory.js.es6
aleph_analytics-0.2.0 public/assets/angular/services/model_generation/resource_factory.js-e8ce2f4be9383d885dbb965c8e425bab.es6
aleph_analytics-0.1.0 public/assets/angular/services/model_generation/resource_factory.js-e8ce2f4be9383d885dbb965c8e425bab.es6
aleph_analytics-0.1.0 app/assets/javascripts/angular/services/model_generation/resource_factory.js.es6
aleph_analytics-0.0.6 public/assets/angular/services/model_generation/resource_factory.js-e8ce2f4be9383d885dbb965c8e425bab.es6
aleph_analytics-0.0.6 app/assets/javascripts/angular/services/model_generation/resource_factory.js.es6