schmod / babel-plugin-angularjs-annotate

Add Angular 1.x dependency injection annotations to ES6 code
http://schmod.github.io/babel-plugin-angularjs-annotate
MIT License
240 stars 29 forks source link

support class assigned to var #55

Open timofei-iatsenko opened 4 years ago

timofei-iatsenko commented 4 years ago

Support case when class expression assigned to a variable.

let Foo = class Foo {
      constructor($element) {
        'ngInject';
      }
    };

Closes https://github.com/schmod/babel-plugin-angularjs-annotate/issues/44

That pattern typically happens in generated code of classes + decorators, when plugin piped after typescript compiler.

timofei-iatsenko commented 4 years ago

@schmod please review and merge