https://github.com/seiyria/ng2-pnotify
PNotify for angular2.
https://github.com/seiyria/ng2-pnotify
angular2 ng2 pnotify
Last synced: 5 months ago
JSON representation
PNotify for angular2.
- Host: GitHub
- URL: https://github.com/seiyria/ng2-pnotify
- Owner: seiyria
- License: mit
- Archived: true
- Created: 2016-06-26T03:55:41.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-23T18:40:44.000Z (almost 10 years ago)
- Last Synced: 2025-10-14T05:06:09.984Z (8 months ago)
- Topics: angular2, ng2, pnotify
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ng2-pnotify
A service wrapping [PNotify](https://github.com/sciactive/pnotify) for ng2.
# Install
`npm i -s ng2-pnotify`
# Usage
First, bootstrap the service globally:
```js
import { PNotifySettings } from 'ng2-pnotify';
bootstrap(App, [
provide(PNotifySettings, { useValue: { styling: 'bootstrap3' } }) // defaults to 'brighttheme'
]);
```
Next, inject it into a component:
```js
import { PNotifyService } from 'ng2-pnotify';
@Component({
providers: [PNotifyService],
template: `click`
})
export class MyComponent {
static get parameters() {
return [[PNotifyService]];
}
constructor(pnotify) {
this.pnotify = pnotify;
}
notify() {
this.pnotify.info({ text: 'hello!' });
}
}
```
# Options
Name | Default | Description
---- | ------- | -----------
styling | 'brighttheme' | The theme for pnotify to use. Valid settings are 'brighttheme', 'jqueryui', 'fontawesome', 'bootstrap3' - you must have the corresponding CSS for each of these.
# Functions
Name | Description
---- | -----------
success | Creates a success dialog.
notice | Creates a notice dialog.
error | Creates an error dialog.
info | Creates an info dialog.
pnotify | Creates a custom dialog.
desktop | Requests permission to use desktop mode.
# TODO
Wrappers for more functions, like prompts, modals, confirms.