I need to write a function that uses native async/await in Angular.
Example:
var function = () => {
var _self = {};
_self.test = async () => {
return await someAsyncFunc();
}
return _self;
}
When I do ng build --prod
the configuration optimizes it and uses zone.js and catch async/await to handle the changes.
Is there a way to avoid this?
Dirty solutions:
Make it a string with `` for example.
Declare some vars and then
.toString()
and replace with correct syntax before executing it. (Actually in use)
Anyone have a better/clean solution?
Thanks