README
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.