mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-06-15 00:31:34 +02:00
feat(core): add notification feedback with angular-ui-notification (#1532)
Added visual notification for user/article updates angular-ui-notification config added to core client config Notification idea from #369
This commit is contained in:
@@ -5,14 +5,13 @@
|
||||
.module('articles.admin')
|
||||
.controller('ArticlesAdminController', ArticlesAdminController);
|
||||
|
||||
ArticlesAdminController.$inject = ['$scope', '$state', '$window', 'articleResolve', 'Authentication'];
|
||||
ArticlesAdminController.$inject = ['$scope', '$state', '$window', 'articleResolve', 'Authentication', 'Notification'];
|
||||
|
||||
function ArticlesAdminController($scope, $state, $window, article, Authentication) {
|
||||
function ArticlesAdminController($scope, $state, $window, article, Authentication, Notification) {
|
||||
var vm = this;
|
||||
|
||||
vm.article = article;
|
||||
vm.authentication = Authentication;
|
||||
vm.error = null;
|
||||
vm.form = {};
|
||||
vm.remove = remove;
|
||||
vm.save = save;
|
||||
@@ -22,6 +21,7 @@
|
||||
if ($window.confirm('Are you sure you want to delete?')) {
|
||||
vm.article.$remove(function() {
|
||||
$state.go('admin.articles.list');
|
||||
Notification.success({ message: '<i class="glyphicon glyphicon-ok"></i> Article deleted successfully!' });
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -40,10 +40,11 @@
|
||||
|
||||
function successCallback(res) {
|
||||
$state.go('admin.articles.list'); // should we send the User to the list or the updated Article's view?
|
||||
Notification.success({ message: '<i class="glyphicon glyphicon-ok"></i> Article saved successfully!' });
|
||||
}
|
||||
|
||||
function errorCallback(res) {
|
||||
vm.error = res.data.message;
|
||||
Notification.error({ message: res.data.message, title: '<i class="glyphicon glyphicon-remove"></i> Article save error!' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user