angular-notifier icon indicating copy to clipboard operation
angular-notifier copied to clipboard

Custom Template didn't show dismiss button

Open th3conc3pt3ur opened this issue 2 years ago • 5 comments

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 : image

Builtin : image

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

th3conc3pt3ur avatar Aug 18 '21 14:08 th3conc3pt3ur

I faced with the same problem. I used this.notifier.hide('THAT_NOTIFICATION_ID');

VitaliiLitkevichVL avatar Sep 24 '21 11:09 VitaliiLitkevichVL

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.

Vitomir2 avatar Jan 19 '22 11:01 Vitomir2

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

VitaliiLitkevichVL avatar Jan 19 '22 12:01 VitaliiLitkevichVL

Yeah, I just did that, but forgot to edit my comment :) Thanks!

Vitomir2 avatar Jan 19 '22 13:01 Vitomir2

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

H3AR7B3A7 avatar Oct 13 '22 21:10 H3AR7B3A7