Comments (9)
Any news on this?
from babel-plugin-angularjs-annotate.
@mattbrunetti hi, have you found any way to fix it/work around it?
from babel-plugin-angularjs-annotate.
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 _x
issue before, as Babel's promise to run plugins before presets isn't actually respected in some cases.
from babel-plugin-angularjs-annotate.
@gdaszuta @mattbrunetti Just curious: What is your use-case for this. Does Angular even know what to do with an async function?
from babel-plugin-angularjs-annotate.
@schmod We were trying to use async functions in resolve functions used with angular-ui-router. These functions are called with $injector.invoke()
and are expected to return a promise. I don't think Angular's invoke function needs to do anything special with them or even be aware that they're async.
@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 ...
resolve: {
async someResource (someService) {
'ngInject'
// ...
}
}
... do this ...
resolve: {
someResource (someService) {
'ngInject'
return (async () => {
// ...
})()
}
}
from babel-plugin-angularjs-annotate.
2019, still not working :(
from babel-plugin-angularjs-annotate.
@LM-G 2019 and you're using Angular 1?
from babel-plugin-angularjs-annotate.
@zenflow Sadly, yes :( . I just joined an organization which is migrating an old ng1 app to a new fancy one with VueJS.
from babel-plugin-angularjs-annotate.
one with VueJS.
Please let us know how that worked out :D
from babel-plugin-angularjs-annotate.
Related Issues (20)
- Support for @ngInject within JSDoc blocks HOT 2
- 0.8.2 is extremely slow HOT 5
- $inject is not added on exported class when transforming to ES5 HOT 1
- Remove prologue string? HOT 1
- Any way to catch babel-renamed function arguments? HOT 3
- "Module 'xxx' is not available!" errors when converting from ngAnnotate HOT 2
- babel 7 support HOT 8
- Not working when some property of the class has a Decorator HOT 2
- Unexpected token HOT 2
- Question not issue babel-plugin-angularjs-annotate for replace ng-annotate with grunt HOT 3
- Method names can shadow import names HOT 1
- Option for a decorator HOT 1
- doesn't work with babel-core >= 7.0 HOT 1
- Project with angular and vue code
- codeFrame is not a function
- Cannot set property $inject of function SomeController which has only a getter HOT 6
- Can not inject dependencies on class when declared on an object property
- Underscore "_" breaks annotations when "@babel/plugin-proposal-class-properties" is used
- What does "Declarator name different _elementReadyDirectiveFactory" actually indicate?
- Unit tests failing since `@babel/plugin-transform-classes` 7.16.5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babel-plugin-angularjs-annotate.