Skip to content

Commit ec2356c

Browse files
committed
github pages
1 parent fe0d78c commit ec2356c

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

docs/example.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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() {

docs/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@
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

0 commit comments

Comments
 (0)