import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { faCheckCircle, faTimesCircle, faInfoCircle, faXmark } from '@fortawesome/free-solid-svg-icons'; import { ToastService } from '../services/toast.service'; @Component({ selector: 'app-toast-container', changeDetection: ChangeDetectionStrategy.OnPush, imports: [FontAwesomeModule], template: `
@for (toast of toasts.toasts(); track toast.id) { }
`, }) export class ToastContainerComponent { protected readonly toasts = inject(ToastService); protected readonly faCheckCircle = faCheckCircle; protected readonly faTimesCircle = faTimesCircle; protected readonly faInfoCircle = faInfoCircle; protected readonly faXmark = faXmark; }