I bound the below method to a click event
getValue() {
this.ready = Promise.resolve('test');
}
and on ngOnInit I am expecting the Promise.then to fire as,
ngOnInit() {
this.ready.then((res) => alert(res));
}
Whenever I click the button, I call the getValue method, and expect the Promise.then to fire
Why is it not working?
Link to my code
Via Active questions tagged javascript - Stack Overflow https://ift.tt/gRsVZjA
Comments
Post a Comment