4
4
5
5
< meta charset ="utf-8 ">
6
6
7
- < link rel ="stylesheet " href ="/bower_components /bootstrap/dist/css/bootstrap.min.css ">
8
- < link rel ="stylesheet " href ="/bower_components/ pnotify/pnotify.core .css ">
9
- < link rel ="stylesheet " href ="/bower_components/ pnotify/pnotify.buttons.css ">
10
-
11
- < script src ="/bower_components /jquery/dist/jquery.min.js "> </ script >
12
- < script src ="/bower_components /angular/angular.js "> </ script >
13
- < script src ="/bower_components/ pnotify/pnotify.core .js "> </ script >
14
- < script src ="/bower_components/ pnotify/pnotify.confirm.js "> </ script >
15
- < script src ="/bower_components/ pnotify/pnotify.buttons.js "> </ script >
16
- < script src ="/ src/angular-pnotify.js "> </ script >
17
-
7
+ < link rel ="stylesheet " href ="node_modules /bootstrap/dist/css/bootstrap.min.css ">
8
+ < link rel ="stylesheet " href ="node_modules/ pnotify/dist/ pnotify.css ">
9
+ < link rel ="stylesheet " href ="node_modules/ pnotify/dist /pnotify.buttons.css ">
10
+
11
+ < script src ="node_modules /jquery/dist/jquery.min.js "> </ script >
12
+ < script src ="node_modules /angular/angular.js "> </ script >
13
+ < script src ="node_modules/ pnotify/dist/ pnotify.js "> </ script >
14
+ < script src ="node_modules/ pnotify/dist /pnotify.confirm.js "> </ script >
15
+ < script src ="node_modules/ pnotify/dist /pnotify.buttons.js "> </ script >
16
+ < script src ="src/angular-pnotify.js "> </ script >
17
+
18
18
</ head >
19
19
20
20
< body ng-app ="pnotify-demo ">
21
21
22
22
< div ng-controller ="MyCtrl ">
23
-
23
+
24
24
< div class ="container-fluid ">
25
-
25
+
26
26
< div class ="page-header ">
27
27
< h1 > angular-pnotify demo</ h1 >
28
28
</ div >
29
-
29
+
30
30
< p > View source for more details.</ p >
31
31
< hr >
32
32
@@ -45,24 +45,24 @@ <h1>angular-pnotify demo</h1>
45
45
< p > < button ng-click ="error() " class ="btn btn-danger "> Error</ button > </ p >
46
46
< p > < pre > notificationService.error('Error text')</ pre > </ p >
47
47
< hr >
48
-
48
+
49
49
< p > Use the generic PNotify object.</ p >
50
50
< p > < button ng-click ="generic() " class ="btn btn-primary "> Generic PNotify</ button > </ p >
51
51
< p >
52
52
< pre >
53
53
notificationService.notify({
54
- title: 'The notice title.',
54
+ title: 'The notice title.',
55
55
title_escape: false,
56
56
text: 'The notice text.',
57
57
text_escape: false,
58
58
styling: "bootstrap3",
59
- type: "notice",
59
+ type: "notice",
60
60
icon: true
61
61
});
62
62
</ pre >
63
63
</ p >
64
64
< hr >
65
-
65
+
66
66
< p > < button ng-click ="confirmDialog() " class ="btn btn-primary "> Confirm dialog</ button > </ p >
67
67
< p >
68
68
< pre >
@@ -89,7 +89,7 @@ <h1>angular-pnotify demo</h1>
89
89
</ p >
90
90
< hr >
91
91
92
- < p > < button ng-click ="overrideDefaults() " class ="btn btn-primary "> Override defaults</ button > </ p >
92
+ < p > < button ng-click ="overrideDefaults() " class ="btn btn-primary "> Override defaults</ button > </ p >
93
93
< p >
94
94
< pre >
95
95
notificationService.notifyWithDefaults({
@@ -99,8 +99,8 @@ <h1>angular-pnotify demo</h1>
99
99
</ pre >
100
100
</ p >
101
101
< hr >
102
-
103
- < p > < button ng-click ="stackTopLeft() " class ="btn btn-primary "> Stack top left</ button > </ p >
102
+
103
+ < p > < button ng-click ="stackTopLeft() " class ="btn btn-primary "> Stack top left</ button > </ p >
104
104
< p >
105
105
In config:
106
106
< pre >
@@ -109,16 +109,16 @@ <h1>angular-pnotify demo</h1>
109
109
dir1: 'down',
110
110
dir2: 'right',
111
111
push: 'top'
112
- });
112
+ });
113
113
</ pre >
114
114
In controller:
115
115
< pre >
116
116
notificationService.info('Hello World : Top left', 'top_left');
117
117
</ pre >
118
118
</ p >
119
119
< hr >
120
-
121
- < p > < button ng-click ="stackBottomRight() " class ="btn btn-primary "> Stack bottom right</ button > </ p >
120
+
121
+ < p > < button ng-click ="stackBottomRight() " class ="btn btn-primary "> Stack bottom right</ button > </ p >
122
122
< p >
123
123
In config:
124
124
< pre >
@@ -135,19 +135,30 @@ <h1>angular-pnotify demo</h1>
135
135
notificationService.info('Hello World : Bottom right', 'bottom_right');
136
136
</ pre >
137
137
</ p >
138
+ < hr >
139
+
140
+ < p > < button ng-click ="removeNotifications() " class ="btn btn-primary "> Remove all notifications</ button > </ p >
141
+ < p >
142
+ In controller:
143
+ < pre >
144
+ notificationService.removeNotifications();
145
+ </ pre >
146
+ </ p >
138
147
139
148
</ div >
149
+
140
150
</ div >
141
-
151
+
142
152
< script >
143
153
144
154
angular . module ( 'pnotify-demo' , [ 'jlareau.pnotify' ] )
145
-
155
+
146
156
. config ( [ 'notificationServiceProvider' , function ( notificationServiceProvider ) {
147
157
148
158
notificationServiceProvider
149
-
159
+
150
160
. setDefaults ( {
161
+ styling : 'bootstrap3' ,
151
162
delay : 4000 ,
152
163
buttons : {
153
164
closer : false ,
@@ -172,7 +183,7 @@ <h1>angular-pnotify demo</h1>
172
183
dir2 : 'right' ,
173
184
push : 'top'
174
185
} )
175
-
186
+
176
187
;
177
188
178
189
} ] )
@@ -199,12 +210,12 @@ <h1>angular-pnotify demo</h1>
199
210
200
211
// This is a sample using the generic PNotify object
201
212
notificationService . notify ( {
202
- title : 'The notice title.' ,
213
+ title : 'The notice title.' ,
203
214
title_escape : false ,
204
215
text : 'The notice text.' ,
205
216
text_escape : false ,
206
217
styling : 'bootstrap3' ,
207
- type : 'notice' ,
218
+ type : 'notice' ,
208
219
icon : true
209
220
} ) ;
210
221
@@ -231,7 +242,7 @@ <h1>angular-pnotify demo</h1>
231
242
alert ( 'Ok, cool.' ) ;
232
243
} ) . on ( 'pnotify.cancel' , function ( ) {
233
244
alert ( 'Oh ok. Chicken, I see.' ) ;
234
- } ) ;
245
+ } ) ;
235
246
236
247
} ;
237
248
@@ -250,6 +261,10 @@ <h1>angular-pnotify demo</h1>
250
261
notificationService . info ( 'Hello World : Bottom right' , 'bottom_right' ) ;
251
262
} ;
252
263
264
+ $scope . removeNotifications = function ( ) {
265
+ notificationService . removeNotifications ( ) ;
266
+ }
267
+
253
268
} ] ) ;
254
269
255
270
</ script >
0 commit comments