0.1.0 • Published 9 years ago

babel-plugin-angular2-at-annotation v0.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
9 years ago

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.