1var delayInMilliseconds = 1000; //1 second
2
3setTimeout(function() {
4 //your code to be executed after 1 second
5}, delayInMilliseconds);
6
1//You have to wait for TypeScript 2.0 with async/await for ES5 support as it now supported only for TS to ES6 compilation.
2//You would be able to create delay function with async:
3
4function delay(ms: number) {
5 return new Promise( resolve => setTimeout(resolve, ms) );
6}
7
8//And call it
9await delay(300);