File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -6,18 +6,20 @@ window.angular.module('exampleApp', [
66] ) . controller ( 'exampleForm' , [ '$scope' , function ( $scope ) {
77 'use strict' ;
88
9+ $scope . title = 'Example Notification' ;
910 $scope . text = 'This is some notification text.' ;
1011} ] ) . directive ( 'showButton' , [ 'webNotification' , function ( webNotification ) {
1112 'use strict' ;
1213
1314 return {
1415 restrict : 'C' ,
1516 scope : {
17+ notificationTitle : '=' ,
1618 notificationText : '='
1719 } ,
1820 link : function ( scope , element ) {
1921 element . on ( 'click' , function onClick ( ) {
20- webNotification . showNotification ( 'Example Notification' , {
22+ webNotification . showNotification ( scope . notificationTitle , {
2123 body : scope . notificationText ,
2224 icon : 'https://rawgit.com/sagiegurari/angular-web-notification/master/alert.ico' ,
2325 onClick : function onNotificationClicked ( ) {
Original file line number Diff line number Diff line change 1414
1515 < body >
1616 < form class ="notification-form " ng-controller ="exampleForm ">
17+ < div class ="form-group ">
18+ < label for ="title "> Title</ label >
19+ < input type ="text " class ="form-control " id ="title " placeholder ="Notification Title " ng-model ="title ">
20+ </ div >
1721 < div class ="form-group ">
1822 < label for ="message "> Notification Text</ label >
1923 < textarea class ="form-control " rows ="3 " id ="message " placeholder ="Notification Text " ng-model ="text "> </ textarea >
2024 </ div >
21- < button class ="show-button btn btn-primary " notification-text ="text "> Show Notification</ button >
25+ < button class ="show-button btn btn-primary " notification-title =" title " notification- text ="text "> Show Notification</ button >
2226 </ form >
2327 </ body >
2428
You can’t perform that action at this time.
0 commit comments