-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not work with async functions #20
Comments
@mattbrunetti hi, have you found any way to fix it/work around it? |
Hooooooboy. I'll have to take a look. I have not run tests against the presets that include support for async functions. IIRC, we've run into the |
@gdaszuta @mattbrunetti Just curious: What is your use-case for this. Does Angular even know what to do with an async function? |
@schmod We were trying to use async functions in resolve functions used with angular-ui-router. These functions are called with @gdaszuta We determined two workarounds.. (a) avoid using async functions, or (b) separate into two functions: the injected function and the async function. example: Instead of this ...
... do this ...
|
Any news on this? |
2019, still not working :( |
@LM-G 2019 and you're using Angular 1? |
@zenflow Sadly, yes :( . I just joined an organization which is migrating an old ng1 app to a new fancy one with VueJS. |
Please let us know how that worked out :D |
We are using babel-preset-env and this plugin; no other presets or plugins.
Given the source...
the output from babel is this...
I see 3 problems with this:
myFunction.$inject
should be set with['someService']
rather than['_x']
['someService', ...]
should bemyFunction
rather than_callee
$inject
property way.I believe the desired output would be something like so...
I thought the problem may be that the transforms for async/await are being applied first, but apparently that is not so:
Source: https://babeljs.io/docs/plugins/#plugin-preset-ordering
@schmod Any ideas how to get around this? (Thanks for stepping up to give ng-annotate es6 support btw. I think this package will catch on and be greatly appreciated by the community!)
The text was updated successfully, but these errors were encountered: