angular settimeout code example
Example 1: settimeout in angular
// var that = this; // no need of this line
this.messageSuccess = true;
setTimeout(()=>{ //<<<---using ()=> syntax
this.messageSuccess = false;
}, 3000);
Example 2: javascript settimeout
setTimeout(function(){ alert("Hello"); }, 3000);
Example 3: js settimeout
setTimeout(() => { alert('Hello') }, 1000)