Giter Site home page Giter Site logo

ng2-pnotify's Introduction

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.

ng2-pnotify's People

Contributors

chron0 avatar seiyria avatar

Watchers

 avatar  avatar  avatar  avatar

ng2-pnotify's Issues

Update peerDependencies

Trying to install; however, peerDependencies are unsatisfied with latest Angular 2 release candidate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.