question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support ES6 syntax

See original GitHub issue

Using 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:closed
  • Created 9 years ago
  • Comments:40 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
pmowrercommented, Sep 3, 2015

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\(.*?\)$

1reaction
olovcommented, May 15, 2015

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 like myMod or myMod.foo.

As an example (from the README), --regexp "^require(.*)$" will work properly for require('app-module').controller(..). In your case, perhaps try --regexp "angular.*\.module(.*)$" (not tested).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found