UNPKG

zettapi_client

Version:

Client side CRUD operations in angular to use with zettapi_server rest api to get started quickly in any CMS project

23 lines (22 loc) 867 B
app.service('$report', function($http, blockUI, $httpParamSerializer) { this.getMetadata = function(reportKey, callback) { blockUI.start('A obter meta dados...'); $http.get('/api/report/metadata/' + reportKey).then(function(response) { callback(null, response.data); }).catch(function(response) { callback(response.data); }).finally(function() { blockUI.stop(); }); }; this.getReport = function(reportKey, item, callback) { blockUI.start('A obter dados...'); $http.get('/api/report/get/' + reportKey + '?' + $httpParamSerializer(item)).then(function(response) { callback(null, response.data); }).catch(function(response) { callback(response.data); }).finally(function() { blockUI.stop(); }); }; });