zettapi_client
Version:
Client side CRUD operations in angular to use with zettapi_server rest api to get started quickly in any CMS project
16 lines (14 loc) • 577 B
JavaScript
app.service('$newsletter', function ($entity, blockUI) {
this.subscribe = function (item) {
if (!item) return;
blockUI.start("A gravar email...");
$entity.add('newsletter', item).then(function (response) {
swal("Newsletter", 'Email gravado com sucesso', 'success');
}).catch(function (response) {
swal("Newsletter", 'Não foi possível registar o seu email de momento por favor tente novamente', 'warning');
}).finally(function () {
callback();
blockUI.stop();
});
};
});