angular-notifier
angular-notifier copied to clipboard
Custom Template didn't show dismiss button
Hi there, I give a try to this lib and i'm pretty happy with it ! But i've a little trouble to customize it.
I use a custom template for angular-notifier for adding icon.
When i'm using builtin template i got the dismiss button , but when a use my custom template this button disappears
Custom template :
Builtin :
My custom template :
<ng-template #customTemplate let-notification="notification">
<div>
<fa-icon *ngIf="notification.type == 'error'" [icon]="faExclamationTriangle"></fa-icon> {{ notification.message }}
</div>
</ng-template>
Should i add this button manually ? if yes how ? Thx
I faced with the same problem. I used this.notifier.hide('THAT_NOTIFICATION_ID');
Hi, I face the same problem and I cannot find a way to solve it. Please @dominique-mueller, can you update this, or anyone else?
@VitalyLitkevich why you are using hide? This will not help the dismiss button to appear.
Hi, I face the same problem and I cannot find a way to solve it. Please @dominique-mueller, can you update this, or anyone else?
@VitalyLitkevich why you are using hide? This will not help the dismiss button to appear.
You can add your own custom button in custom template and than use this.notifier.hide('THAT_NOTIFICATION_ID') to hide your notifier
Yeah, I just did that, but forgot to edit my comment :) Thanks!
Here are some slightly more advanced working examples (to those on npm) for working around some of the limitations people have been running in to:
https://stackblitz.com/edit/angular-ivy-yft5xg?file=src/app/app.component.ts
Feel free to fork or use any of it in the docs. Thanks for the nice work @dominique-mueller ! Cheers