Support ES6 syntax
See original GitHub issueUsing ES6 arrow functions causes parse errors in ng-annotate.
Running ng-annotate after transpilation is not possible due to Traceur removing comments, meaning explicit @ngAnnotate
markers go missing.
Issue Analytics
- State:
- Created 9 years ago
- Comments:40 (19 by maintainers)
Top Results From Across the Web
"es6" | Can I use... Support tables for HTML5, CSS3, etc
As ES6 refers to a huge specification and browsers have various levels of support, "Supported" means at least 95% of the spec is...
Read more >JavaScript ES6 - W3Schools
Arrow functions allows a short syntax for writing function expressions. You don't need the function keyword, the return keyword, and the curly brackets....
Read more >How to enable ES6 (and beyond) syntax with Node and Express
We need a package that translates ES6 and above syntax to ES5 code. ES5 code is the JS syntax style that is readable...
Read more >ECMAScript 6: New Features: Overview and Comparison
Support for constants (also known as "immutable variables"), i.e., variables which cannot be re-assigned new content. Notice: this only makes the variable ...
Read more >Why You Should Use ES6 - ITNEXT
The most popular features (I will explain later) are supported by all the current browsers very well. If you are a nodejs developer,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s a bit ironic that one of Babel’s selling points is clearer transpiled source, yet it doesn’t work out of the box with ng-annotate, unlike Traceur.
@olov Thanks for the regex, that works (at least for our purposes)! I’ve modified it the following way for safety:
angular.*?\.module\(.*?\)$
Check out our
regexp
option https://github.com/olov/ng-annotate#declaration-forms. You case use that to match[regexp].controller
and so on. The default regexp is^[a-zA-Z0-9_\$\.\s]+$
which matches things likemyMod
ormyMod.foo
.As an example (from the README),
--regexp "^require(.*)$"
will work properly forrequire('app-module').controller(..)
. In your case, perhaps try--regexp "angular.*\.module(.*)$"
(not tested).