0.0.5 • Published 4 years ago

@benevideschissanga/ngx-bootstrap-alert-notification v0.0.5

Weekly downloads
19
License
MIT
Repository
github
Last release
4 years ago

Every feedback is welcome!

Demo

Installation

Install via npm:

$ npm install @benevideschissanga/ngx-bootstrap-alert-notification --save

or yarn:

$ yarn add @benevideschissanga/ngx-bootstrap-alert-notification

Usage

To use ngx-bootstrap-alert-notification

In your main module, import NgxBootstrapAlertNotificationModule.forRoot()

In your component inject the NgxBootstrapAlertNotificationService and use like:

this.notificationService.show(
  {
    type: 'danger',
    message:
      'This is a notification with close button and icon and can have many lines.',
    icon: 'icon icon-bell-55',
    title: 'Danger',
  },
  {
    position: 'topRight',
  }
)

NotificationData

Property NameProperty TypeProperty Value
typeNotificationTypewarning, success, primary, info, danger
titlestringTitle for the alert
iconstringIcon class name
messagestringMessage to display
templateTemplateRefCustom template

NotificationConfig

You can pass custom configs

Property NameProperty TypeProperty Value
positionstringtopLeft, topCenter, topRight, bottomLeft, bottomCenter, bottomRight
animationbooleanShould be animated or not
timeOutnumberDelay time to auto close the alert
dismissiblebooleanShould auto close or not
uniquebooleanDont show duplicated messages if true

Versions

0.0.3 - Angular 8

0.0.4 - Angular 9 0.0.5 - Angular 10