https://github.com/hanford/angular-notify
A super tiny angular service with a easy API for using browser notifications.
https://github.com/hanford/angular-notify
Last synced: 4 months ago
JSON representation
A super tiny angular service with a easy API for using browser notifications.
- Host: GitHub
- URL: https://github.com/hanford/angular-notify
- Owner: hanford
- License: mit
- Created: 2016-02-23T20:41:40.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-05-04T16:04:15.000Z (almost 9 years ago)
- Last Synced: 2024-08-09T12:47:15.510Z (9 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 16
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
## angular-notify
[![NPM][notify-icon]][notify-url]
#### Installation
Installation is super easy, simply add the dependencies to your angular module, and inject ```notify``` in your angular service, component, directive or controller.```
# use npm
$ npm install angular-notify
```Add angular-notify to your dependencies
```
angular
.module('yourApp', ['angular-notify'])
.controller('SampleController', function (notify) {
function onClick () {
console.log('clicked notification!')
}notify.show('Example Notification', 'path/icon.jpg', 5000, onClick)
})
```#### API
##### *message*The first parameter is the message for the notification
##### *icon*
The second parameter is the icon for the notification
##### *timeout*
timeout determines how long to keep the notification, (default is 5000 milliseconds)
##### *callback*
The function you want to call when the notification is clicked
[notify-icon]: https://nodei.co/npm/angular-notify.png?downloads=true
[notify-url]: https://npmjs.org/package/angular-notify