Arnold Arnold - 3 months ago 24
TypeScript Question

How to put time outs in angular2

I want to show a success message on firing submit button but only after 10 some sort of time and for that i wrote the following lines.

let timeoutId = setTimeout(() => {
this.success = true;;

Simmilarly,i want to close the message after certain amout of time ,let 5 sec .Can anyone suggest me how to do that.Thanks.

Observable.timer(500).subscribe(() => this.success = true)