Created
May 13, 2017 04:28
-
-
Save ipassynk/f562c773c9e0051a7dbc2e2c37baf87b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface OnInit { | |
ngOnInit(): void; | |
} | |
class stackoverflow implements OnInit { | |
async ngOnInit() { | |
return await new Promise(res => { | |
setTimeout(() => { | |
alert('ngOnInit'); | |
res(); | |
}, 2000); | |
}) | |
} | |
afterngOnInit() { | |
alert('should i be called after ngOnInit???'); | |
} | |
} | |
let s = new stackoverflow(); | |
s.ngOnInit(); | |
s.afterngOnInit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment