-
Notifications
You must be signed in to change notification settings - Fork 9
/
demo.js
55 lines (51 loc) · 1.17 KB
/
demo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
(function () {
'use strict';
angular.module('nottyApp', ['notyModule'])
.config(function (notyProvider) {
notyProvider.settings = {
theme: 'metroui',
text: 'Custom default message',
layout: 'topRight',
force: true,
easing: 'swing',
timeout: 5000,
animation: {
open: 'animated fadeInUp',
close: 'animated fadeOutDown',
easing: 'swing'
}
}
})
.controller('AppCtrl', function ($scope, noty) {
$scope.showNotification = function () {
noty.show('Test message','information');
};
$scope.showAlert = function () {
noty.showAlert('Alert!')
};
$scope.showError = function () {
noty.showError('Test message');
};
$scope.closeAll = function () {
noty.closeAll()
};
$scope.prompt = function () {
noty.call({
text: 'Are you sure you want to delete ITEM?',
buttons: [
{
addClass: 'btn btn-primary', text: 'Yes, delete', onClick: function($noty) {
$scope.delete(item);
noty.closeAll();
}
},
{
addClass: 'btn btn-danger', text: 'Cancel', onClick: function($noty) {
noty.closeAll();
}
}
]
});
}
});
})();