1.2.1 • Published 5 years ago

ng-alertbar v1.2.1

Weekly downloads
27
License
MIT
Repository
-
Last release
5 years ago

ngAlertbar

A configurable alertbar for Angular

Installation

  1. Install using npm
npm install --save ng-alertbar
  1. Add the themes/default.css stylesheet to your angular.json styles array

  2. Import NgAlertBarModule into your angular module

@NgModule({
  imports: [..., NgAlertbarModule.forRoot()]
})
  1. Add the alertbar component to your app template
  <ng-alertbar [lifeTime]="3000" ...></ng-alertbar>
  1. Inject NgAlertBarService and call triggerAlert(...)
constructor(private alertBarService: NgAlertBarService) {}

ngOnInit() {
  const options: AlertOptions = {...};
  this.alertBarService.triggerAlert('Custom message', options);
}

Options

Option NameDescriptionTypeDefaultRequired
queueing (component)Whether to add incoming alert triggers to a queue for later display if an alert is currently opentrueboolean
bypassQueue (trigger)Whether the alert should not respect the queueing process. If set to false, the alert will be displayed immediately upon trigger even if another alert is currently shownbooleanfalse
lifeTimeThe time in ms between the alert opening and auto-closing. If the lifetime is set to 0, the alert will not autoclosenumber5000
showDelayThe time in ms between the alert trigger firing and the alert showingnumber100
backgroundColorThe background color of the alertstring'linear-gradient(to top right, #9ce29c, #c9f9b9)'
borderColorThe border color of the alertstring'#34a40e'
textColorThe color of the alert textstring'black'
widthMode'full': The alert will take up the whole width of the container 'partial': The alert will only use the space required'full' | 'partial''partial'
htmlWhether to inject the provided message as html or render it as plaintextbooleanfalse

Note: Options denoted with (component) can only be applied as a component input, whereas options denoted with (trigger) can only be applied to individual alert triggers

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1-hf1

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.1

5 years ago