0.0.8 • Published 5 years ago

ngx-push-notification v0.0.8

Weekly downloads
14
License
-
Repository
-
Last release
5 years ago

NgxPushNotification

This library was generated with Angular CLI version 8.2.11.

Installation

To install this library, run:

npm install ngx-push-notification --save

Setup

Import the NgxPushNotificationService in your component where you want to use it:

import { NgxPushNotificationService } from 'ngx-push-notification';
...
constructor(private ngxPushNotificationService: NgxPushNotificationService) { }
...

Pushing a Notification

Example: app.component.html

<button type="button" (click)="notify()">Notify</button>

app.component.ts

notify() {
    this.ngxPushNotificationService.showNotification({
      title: 'Hello ông thiện',
      body: 'Fuck you ông vũ',
      icon: '../favicon.ico'
    }).subscribe((res: any) => {
      if (res.type === 'show') {
        console.log('show');
      } else if (res.type === 'click') {
        console.log('click');
      } else {
        console.log('close');
      }
    });
  }
0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago