Angular Desktop Notifications helps provide desktop notification for your angular application through a very simple api without any Jquery dependencies. And it only adds ~40 lines to your project.
- Use
bower
orgit clone
to download the module.bower install angular-desktop-notification
git clone https://github.com/kaushiksamanta/angular-desktop-notification.git
- include
angular-desktop-notification.module.js
from src folder. - Inject angular-desktop-notification into your angular module and inject Notification factory into your controller.
<script src="bower_components/src/angular-desktop-notification.module.js"></script>
angular.module('notificationTest', ['angular-desktop-notification']);
angular.module('notificationTest')
.controller('notificationController', function($scope, Notification) {
Notification.initialize('src/dummy.png');
$scope.pop = function() {
Notification.notify($scope.text,'Notification');
}
});
Notification.initialize('src/dummy.png')
- Initialises the notification with icon.Notification.notify('body','Title')
- Pops the notification with title and body as argument.
Works best on latest versions of Google Chrome, Firefox and Safari.