babel-plugin-angular2-at-annotationdeprecated

An experimental babel transformer plugin for Angular 2 @ annotation

Usage no npm install needed!

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

README

build status npm version npm downloads

babel-plugin-angular2-at-annotation

An experimental babel transformer plugin for Angular 2 @ annotation.

Use with --optional es7.decorators.

Example

Before:

@Component({
  selector: 'hello'
})
@Template({
  inline: '<p>Hello, {{name}}!</p>'
})
class HelloComponent {
}

After:

class HelloComponent {
}
Object.defineProperty(HelloComponent, 'annotations', { get: function () {
  return [new Component({
    selector: 'hello'
  }), new Template({
    inline: '<p>Hello, {{name}}!</p>'
  })];
}});

See babel-angular2-app for more complete example.