Skip to content

Instantly share code, notes, and snippets.

@akleandrov
Created March 29, 2017 09:36
Show Gist options
  • Save akleandrov/e3ff8273cd104bdeee4bb24ac96f99c4 to your computer and use it in GitHub Desktop.
Save akleandrov/e3ff8273cd104bdeee4bb24ac96f99c4 to your computer and use it in GitHub Desktop.
/**
* Created by kleandrovaa on 12.01.2017.
*/
/**
* Created by kleandrovaa on 28.12.2016.
*/
'use strict';
snfApp.factory('settingsService', function($http){
let promise;
return {
async: function () {
//if (!promise) {
promise = $http.get(UrlApi + TomcatAppName + "/api/v1/settings/GetAll?login=" + Login).then(function (response) {
return response.data;
});
//}
return promise;
}
};
});
snfApp.service('promptService', ['$uibModal', function (modal) {
const self = this;
self.confirm = function(message){
return new Promise(function(resolve, reject) {
modal.open({
animation: true,
size: "medium",
templateUrl: "/" + TomcatAppName + "/static/views/modal.html",
controller: 'modalPromptController',
resolve: {
message: {text: message}
}
}).result.then(function(response) {
if (response) resolve()
});
});
}
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment