Hectic Platypus
Hectic Platypus

Reputation: 35

Angular Displaying a Message for 5 Seconds

In my code, I need to display a message for 5 seconds and then it should disappear. I'm using Fuse Messages and could not succeed on showing then hiding the message. Here is my code below. What should I do and what am I doing wrong?

TS:

  if (koliList.length == 1) {
    if (this.addPackage(koliList[0], frmControlKoliBarkod) == false) {
      let message = this._messages.Show("Transaction is Successful", "WARNING", 5);
      setTimeout(() => {
        message;
      }, 5000);
      return;
    }
  }

Upvotes: 1

Views: 2342

Answers (1)

Mahesh Sonawane
Mahesh Sonawane

Reputation: 11

make following changes in code.

setTimeout(() => { this.message=""; }, 5000); return this.message;

This will set message to empty string after 5 seconds.

Upvotes: 1

Related Questions