@Component({
template: `
<div class="snackbar-container">
{{ content }} <button (click)="close()">✕</button>
</div>
`
})
export class SnackbarComponent {
@Input() content = '';
@Output() afterClose = new EventEmitter();
constructor(private host: ElementRef<HTMLElement>) { }
get container(): HTMLElement {
return this.host.nativeElement.querySelector('.snackbar-container') as HTMLElement;
}
close() {
this.container.style.animation = 'snackbarOut 0.3s';
}
}