babel-plugin-angular2-type-annotationdeprecated

An experimental babel transformer plugin for Angular 2 type annotation

Usage no npm install needed!

<script type="module">
  import babelPluginAngular2TypeAnnotation from 'https://cdn.skypack.dev/babel-plugin-angular2-type-annotation';
</script>

README

build status npm version npm downloads

babel-plugin-angular2-type-annotation

An experimental babel transformer plugin for Angular 2 type annotation.

Example

Before:

class HelloComponent {
  constructor(@Parent() foo: Foo, bar: Bar) {
  }
}

After:

class HelloComponent {
  constructor(foo: Foo, bar: Bar) {
  }
}
Object.defineProperty(HelloComponent, 'parameters', { get: function () {
  return [[Foo, new Parent()], [Bar]];
}});

See babel-angular2-app for more complete example.