ngx-growl
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

NGX Growl

NGX Growl is a module that displays growl like messages

Dependencies

  • @angular/common
  • @angular/core
  • ngx.logger

Installation

npm install --save ngx-growl

Once installed you need to import our main module:

import {GrowlModule} from 'ngx-growl';

The only remaining part is to list the imported module in your application module, passing in a config to intialize the logger.

@NgModule({
  declarations: [AppComponent, ...],
  imports: [GrowlModule.forRoot({maxMessages: 10, displayTimeMs: 5000}), ...],
  bootstrap: [AppComponent]
})
export class AppModule {
}

Config Options

  • maxMessages - The maximum number of messages allowed to be displayed at a time
  • displayTimeMs - The time a message will display before being automatically hidden in milliseconds

Usage

To use NGX Growl, you will need to add it to your an application html file

<ngx-growl></ngx-growl>
 

Import the service

import {GrowlService} from 'ngx-growl';
 

Intect the service

  constructor(private growlServiceGrowlService) {  }
 

Then call one of the methods

this.growlService.addError(`You're Error message goes here`);
this.growlService.addError({heading: 'Oops', message: 'an error has occured'});
 
 

Readme

Keywords

Package Sidebar

Install

npm i ngx-growl

Weekly Downloads

30

Version

1.0.3

License

MIT

Unpacked Size

23.2 kB

Total Files

10

Last publish

Collaborators

  • dbfannin