add the survey service

pull/339/head
Ayyoub allali 2017-08-21 04:08:29 +01:00
parent 21e9387700
commit 8f25f3da42
1 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,40 @@
/**
* @author ayoub
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.surveys')
.factory('SurveyService',SurveyService);
/** @ngInject */
function SurveyService($http, $q) {
var apiBaseUrl = "http://localhost:9000"
function list() {
return [];
}
function create(survey) {
var url = apiBaseUrl + "/surveys";
// Make the API call
return $http.post(url, survey);
}
function edit(survery) {
console.log("edit jSurvey Opject", survey);
}
function remove(survery) {
console.log("remove Opject", survey);
}
return {
list:list,
create:create,
edit:edit,
remove:remove
}
}
})();