ng2-pnotify

WebJar for ng2-pnotify

License

License

MIT
Categories

Categories

Github Development Tools Version Controls
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

github-com-seiyria-ng2-pnotify
Last Version

Last Version

0.0.3
Release Date

Release Date

Type

Type

jar
Description

Description

ng2-pnotify
WebJar for ng2-pnotify
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/seiyria/ng2-pnotify

Download github-com-seiyria-ng2-pnotify

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-seiyria-ng2-pnotify/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-seiyria-ng2-pnotify</artifactId>
    <version>0.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-seiyria-ng2-pnotify/
implementation 'org.webjars.npm:github-com-seiyria-ng2-pnotify:0.0.3'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-seiyria-ng2-pnotify/
implementation ("org.webjars.npm:github-com-seiyria-ng2-pnotify:0.0.3")
'org.webjars.npm:github-com-seiyria-ng2-pnotify:jar:0.0.3'
<dependency org="org.webjars.npm" name="github-com-seiyria-ng2-pnotify" rev="0.0.3">
  <artifact name="github-com-seiyria-ng2-pnotify" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-seiyria-ng2-pnotify', version='0.0.3')
)
libraryDependencies += "org.webjars.npm" % "github-com-seiyria-ng2-pnotify" % "0.0.3"
[org.webjars.npm/github-com-seiyria-ng2-pnotify "0.0.3"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : pnotify jar [3.0.0,4)

Project Modules

There are no modules declared in this project.

ng2-pnotify

A service wrapping PNotify for ng2.

Install

npm i -s ng2-pnotify

Usage

First, bootstrap the service globally:

import { PNotifySettings } from 'ng2-pnotify';

bootstrap(App, [
  provide(PNotifySettings, { useValue: { styling: 'bootstrap3' } }) // defaults to 'brighttheme'
]);

Next, inject it into a component:

import { PNotifyService } from 'ng2-pnotify';

@Component({
  providers: [PNotifyService],
  template: `<button (click)="notify()">click</button>`
})
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.

Versions

Version
0.0.3