Blame view
app/partials/ContactView/ContactView.service.js
1.23 KB
4bb02bb84
|
1 2 3 |
(function(){ 'use strict'; angular.module('acufuel') |
2c476c756
|
4 |
.service('ContactViewService', ['$q', '$http', 'BASE_URL', ContactViewService]); |
4bb02bb84
|
5 |
|
2c476c756
|
6 |
function ContactViewService($q, $http, BASE_URL) { |
4bb02bb84
|
7 |
var temp = {}; |
2c476c756
|
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
this.getContacts = function() { var deferred = $q.defer(); $http({ method : 'GET', url : BASE_URL.url +'/user/allContacts', headers : {'Content-Type': 'application/json'}, }) .then(function (result){ deferred.resolve(result.data); },function (result){ deferred.resolve(result.data); }) return deferred.promise; } |
4bb02bb84
|
23 |
|
2c476c756
|
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
this.getCompanies = function() { var deferred = $q.defer(); $http({ method : 'GET', url : BASE_URL.url +'/user/allCompanies', headers : {'Content-Type': 'application/json'}, }) .then(function (result){ deferred.resolve(result.data); },function (result){ deferred.resolve(result.data); }) return deferred.promise; } |
4bb02bb84
|
39 40 41 |
} })(); |