Skip to content

Commit

Permalink
refactor(API Service): change the name of the file and the service
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrchies committed Aug 26, 2015
1 parent b96c216 commit 287de22
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 10 deletions.
11 changes: 1 addition & 10 deletions web/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,7 @@
<script src="scripts/services/template-factory.js"></script>
<script src="scripts/services/policy-factory.js"></script>
<!-- Services ----------------------------------- -->
<<<<<<< HEAD
<script src="scripts/services/api/api-policy-service.js"></script>
<script src="scripts/services/api/api-template-service.js"></script>
<script src="scripts/services/api/api-fragment-service.js"></script>
=======
<script src="scripts/services/api/api_policy_service.js"></script>
<script src="scripts/services/api/api_template_service.js"></script>
<script src="scripts/services/api/api_fragment_service.js"></script>
<script src="scripts/services/main_test.js"></script>
>>>>>>> feature/inputs-v1: duplicate inputs modal - validate form $ validate name
<script src="scripts/services/api.js"></script>
<!-- Tools ----------------------------------- -->
<script src="scripts/lib/stratio.files.utils.js"></script>

Expand Down
10 changes: 10 additions & 0 deletions web/src/scripts/controllers/inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@
.module('webApp')
.controller('InputsCtrl', InputsCtrl);

<<<<<<< HEAD
InputsCtrl.$inject = ['FragmentFactory', 'PolicyFactory', 'TemplateFactory', '$filter', '$modal'];

function InputsCtrl(FragmentFactory, PolicyFactory, TemplateFactory, $filter, $modal) {
=======
InputsCtrl.$inject = ['API', 'FragmentDataService', 'TemplateDataService', '$filter', '$modal'];

function InputsCtrl(API, FragmentDataService, TemplateDataService, $filter, $modal) {
>>>>>>> refactor(API Service): change the name of the file and the service
/*jshint validthis: true*/
var vm = this;

Expand All @@ -34,9 +40,13 @@
};

function getInputs() {
<<<<<<< HEAD
var inputList = FragmentFactory.GetFragments("input");

inputList.then(function (result) {
=======
API.get().$promise.then(function (result) {
>>>>>>> refactor(API Service): change the name of the file and the service
vm.inputsData = vm.setInputsId(result);
vm.getInputTypes(result);
});
Expand Down
42 changes: 42 additions & 0 deletions web/src/scripts/services/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
'use strict';

angular.module('webApp')
.service('API', ['$resource', function ApiDownloadModules($resource) {

/*var url = '/policy/all';*/
/*var url = '/template/inputs';*/
var url = '/fragment/input';

var methods = {
'get' : {method:'GET', isArray:true}
};

var resource = $resource(url,{},methods);

return resource;

/*
this.getInputData = function() {
var vm = th
var url = '/policy/all';
var url = '/template/inputs';
var url = '/fragment/input';
var methods = {
'get' : {method:'GET', isArray:true}
};
var resource = $resource(url,{},methods);
vm.resource = resource.query();
vm.resource.$promise.then(function (result) {
vm.inputsData = result;
console.log(vm.inputsData);
return vm.inputsData;
});
};
*/

}]);

0 comments on commit 287de22

Please sign in to comment.