flauc / angular2-notifications

A light and easy to use notifications library for Angular.
https://stackblitz.com/edit/angular2-notifications-example
MIT License
746 stars 167 forks source link

Html notification #422

Open Luvelnet opened 8 months ago

Luvelnet commented 8 months ago

I am trying to show a notification with html, but there is no way.

This is my code:

const htmlContent = this.sanitizer.bypassSecurityTrustHtml('<div>Nuevo intento de inicio de sesión desde la web</div><div><button (click)="accept()">Aceptar</button><button (click)="reject()">Rechazar</button></div>');

this.notificationsService.html({
          html: htmlContent, 
          type: 'info',
          override:
          {
          timeOut: 0,  
          showProgressBar: false,
          pauseOnHover: false,
          clickToClose: false
}});

And this is my result:

image

Can anybody help me?

R-on commented 7 months ago

The value for html could also be an Angular TemplateRef. Is this a solution for your problem?