Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

155
Vistas
Infragistics: How to show multiple ignite Snackbar using id

I want to show multiple Snackbar on the angular website. I am using ignite UI for angular and using Snackbar from ignite.

<igx-snackbar id="snackbar1" [displayTime]="displayTime">
  <div [class]="leftBorder"></div>
  <div class="snackbar-detail">
    <img [class]="iconType" [alt]="('LBL_CLOSE' | translate)" [src]="iconPath">
    <div class="message-section">
      <div class="snackbar-title">{{messageTitle}}</div>
      <div class="snackbar-message">{{messageDesc}}</div>
    </div>
    <img (click)="closeSnackbar()" class="close-icon" [alt]="('LBL_CLOSE' | translate)"
      src="assets/icons/essentials/close.svg">
  </div>
</igx-snackbar>

I am able to show the snacbar using

 @ViewChild(IgxSnackbarComponent, { static: true }) public igxSnackBar: IgxSnackbarComponent;

 this.igxSnackBar.show();
 

but I want to show another snackbar so I have added id="snackbar1" and able to get the id using

let snackbarId = this.igxSnackBar.id;
console.log(snackbarId);

but I am not able to open the particular snackbar using the id.

can anyone please help me with this?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Why dont you use a specific @ViewChild selector for each of the Snackbar components. You can use a template reference variable:

<igx-snackbar #snackbar1 [autoHide]="false" actionText="CLOSE" (clicked)="close(snackbar1)">Message sent</igx-snackbar>

..

A template reference variable 'snackbar1'

@ViewChild('snackbar1', { static: true }) public igxSnackBar: IgxSnackbarComponent;

With the current implementation that you shared the change detector will look for the first Snackbar in the DOM.

Using of show() method is deprecated in the newer versions, use open() instead.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda