/** * Created by robin on 11/21/15. */ (function () { 'use strict'; angular.module('camotionSdk') .factory('CommandsService', ['luticateRequest', function (luticateRequest) { var CommandsService = {}; CommandsService.add = function(data, promise) { return luticateRequest.post("/api/commands/add", {command: JSON.stringify(data)}, null, promise); }; CommandsService.getAll = function(data, promise) { return luticateRequest.get("/api/commands", data, promise); }; CommandsService.getAllTypes = function(promise) { return luticateRequest.get("/api/commands/types", null, promise); }; CommandsService.get = function(data, promise) { return luticateRequest.get("/api/commands/" + data.command_id , null, promise); }; CommandsService.edit = function(data, promise) { return luticateRequest.post("/api/commands/" + data.command_id + "/edit", {command: JSON.stringify(data)}, null, promise); }; CommandsService.del = function(data, promise) { return luticateRequest.post("/api/commands/" + data.command_id + "/del", null, null, promise); }; CommandsService.exec = function(data, promise) { return luticateRequest.post("/api/commands/" + data.command_id + "/exec", null, null, promise); }; return CommandsService; }]); })();