TG-118 : move OLA/.gitignore to OLA/backend/gitignore (import scripts file)

This commit is contained in:
mpenchenat
2017-03-13 15:44:34 +01:00
parent 33644596ec
commit ab583fb496
5 changed files with 141 additions and 0 deletions

View File

@ -0,0 +1,52 @@
(function () {
'use strict';
angular.module('clientApp')
.factory('DataService', ['$http', '$q',
function ($http, $q) {
// ---------------------------------------------------------------------------
// PUBLIC API.
// ---------------------------------------------------------------------------
return ({
login: login,
logout: logout
});
// ---------------------------------------------------------------------------
// PUBLIC METHODS.
// ---------------------------------------------------------------------------
function login(credentials) {
// var request = $http.post(apiServer + '/api/AppUsers/login', credentials);
// return request.then(handleSuccess, handleError);
}
function logout() {
// var request = $http.post(apiServer + '/api/AppUsers/logout', {});
// return request.then(handleSuccess, handleError);
}
// ---------------------------------------------------------------------------
// PRIVATE METHODS.
// ---------------------------------------------------------------------------
function handleSuccess(response) {
return response.data;
}
function handleError(response) {
if (response.data === '' ||
!angular.isDefined(response.status) ||
response.statusText === '') {
return ($q.reject("An unknown error occurred."));
}
// Otherwise, use expected error message.
return ($q.reject('Error ' + response.status + ' (' + response.statusText + '): ' + response.data));
}
}
]);
})();