diff options
Diffstat (limited to 'esr/src/main/webapp/extsys/sdncontroller/js/DataService.js')
-rw-r--r-- | esr/src/main/webapp/extsys/sdncontroller/js/DataService.js | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/esr/src/main/webapp/extsys/sdncontroller/js/DataService.js b/esr/src/main/webapp/extsys/sdncontroller/js/DataService.js deleted file mode 100644 index f374bbd..0000000 --- a/esr/src/main/webapp/extsys/sdncontroller/js/DataService.js +++ /dev/null @@ -1,80 +0,0 @@ -app.factory("DataService", function($http, $log) { - return { - /** - * - * @param url - url of the service - * @param data - data as an object (used as query string in url) - * @returns {*} - */ - get: function (url, data) { - if(data) { - url += "?"; - for(key in data){ - url += key+ "=" + data[key]; - } - } - return $http({ - url: url, - method: 'GET', - data: null, - headers: {'Content-Type': 'application/json'} - }).then(function (response) { - return response.data; - }); - }, - /** - * - * @param url - url of the service - * @param data - data as an object (used for post method) - * @returns {*} - */ - post: function (url, data) { - return $http({ - url: url, - method: 'POST', - data: data, - headers: {'Content-Type': 'application/json '} - }).then(function (response) { - console.log("Response : "); - $log.info(response.data); - return response.data; - }); - }, - /** - * TODO - To Check for Delete - * @param url - * @param data - * @returns {*} - */ - delete: function (url) { - return $http({ - url: url, - method: 'DELETE', - data: null, - headers: {'Content-Type': 'application/json '} - }).then(function (response) { - console.log("Response : "); - $log.info(response.data); - return response.data; - }); - }, - /** - * - * @param url - * @param data - */ - put: function (url, data) { - return $http({ - url: url, - method: 'PUT', - data: data, - headers: {'Content-Type': 'application/json '} - }).then(function (response) { - console.log("Response : "); - $log.info(response.data); - return response.data; - }); - } - - } -})
\ No newline at end of file |