olov / ng-annotate

Add, remove and rebuild AngularJS dependency injection annotations
MIT License
2.03k stars 152 forks source link

Prettier screws thing up #261

Closed maraisr closed 7 years ago

maraisr commented 7 years ago

Hi, so prettier adds a wrapping bracket to the string ('ngInject') . Which isn't compiling correctly.

class Foo {

  constructor(private $http) {
    ('ngInject');

    this.$http; // undefined
  }
}

TypeScript -> es2017 -> Babel -> es5.

Original question. https://github.com/schmod/babel-plugin-angularjs-annotate/issues/25

maraisr commented 7 years ago

Deprecated - never mind.