File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,13 @@ window.angular.module('exampleApp', [
1212
1313 return {
1414 restrict : 'C' ,
15+ scope : {
16+ notificationText : '='
17+ } ,
1518 link : function ( scope , element ) {
1619 element . on ( 'click' , function onClick ( ) {
1720 webNotification . showNotification ( 'Example Notification' , {
18- body : scope . text ,
21+ body : scope . notificationText ,
1922 icon : 'https://rawgit.com/sagiegurari/angular-web-notification/master/alert.ico' ,
2023 onClick : function onNotificationClicked ( ) {
2124 console . log ( 'Notification clicked.' ) ;
Original file line number Diff line number Diff line change 1616 < form class ="notification-form " ng-controller ="exampleForm ">
1717 < div class ="form-group ">
1818 < label for ="message "> Notification Text</ label >
19- < input type ="text " class ="form-control " id ="message " placeholder ="Notification Text ">
19+ < input type ="text " class ="form-control " id ="message " placeholder ="Notification Text " ng-model =" text " >
2020 </ div >
21- < button class ="show-button btn btn-primary "> Show Notification</ button >
21+ < button class ="show-button btn btn-primary " notification-text =" text " > Show Notification</ button >
2222 </ form >
2323 </ body >
2424
You can’t perform that action at this time.
0 commit comments