Reputation: 88
How do I display error message in my application as oppose to printing in the console. This is an example below (printing in console)
promise.catch(e => console.log(e.message));
I want to be able to print the above in my html.
Any help?
Upvotes: 1
Views: 566
Reputation: 55443
You can use AarrowFunction ()=>
as shown,
promise.catch((error)=>{ this.one = error.message; });
Upvotes: 1