ngx-toastr do not disappear. Angular18

Discussão em 'Angular' iniciado por Zantor, Novembro 14, 2024.

  1. Zantor

    Zantor Guest

    I have following problem. I'm using Angular 18 and ngx-toastr 19.0.0. When I try to use notification in ngOnInit (with 5 sec deley) result is so:

    1- notification is rendered immediately

    2- after 5 sec progress bar stars and go to the end (as it should)

    3- notification didn't disappear even if I click close button.

    Any idea what is going on?

    export class ConfComponent implements OnInit {
    constructor(
    private toastr: ToastrService
    ) { }

    ngOnInit(): void {
    setTimeout(() => {
    this.toastr.info('Message', 'Title', {
    closeButton: true,
    progressBar: true,
    progressAnimation: 'increasing',
    positionClass: 'toast-bottom-left',
    timeOut: 2000
    });
    }, 5000);
    }
    }


    If I start toastr by some button click it works fine.

    Continue reading...

Compartilhe esta Página