github.com/fanux/shipyard@v0.0.0-20161009071005-6515ce223235/controller/static/app/nodes/nodes.service.js (about) 1 (function(){ 2 'use strict'; 3 4 angular 5 .module('shipyard.nodes') 6 .factory('NodesService', NodesService); 7 8 NodesService.$inject = ['$http']; 9 function NodesService($http) { 10 return { 11 list: function() { 12 var promise = $http 13 .get('/api/nodes') 14 .then(function(response) { 15 return response.data; 16 }); 17 return promise; 18 }, 19 removeNode: function(node) { 20 var promise = $http 21 .delete('/api/nodes/' + node.name) 22 .then(function(response) { 23 return response.data; 24 }); 25 return promise; 26 }, 27 } 28 } 29 })();