I\'m roughly following JavaScript/TypeScript quickstart for Angular2 to write my app in ES6 but can\'t get the decoractor to works
You can use ES5 syntax:
import * as ng from 'angular2/core';
const SomeComponent = ng
.Component({ /* ... */})
.View({ /* ... */ })
.Class({
constructor() {}
});
const SomeDirective = ng
.Directive({ /* ... */ })
.Class({
constructor() {}
});
So for your case it will be (see this plunk):
export const AppComponent = Component({
selector: 'my-app',
template: 'Hello {{ name }}
'
})
.Class({
constructor() {
this.name = 'Max';
console.log(this.name);
}
});
PS But if I were you, I would try to resolve the problem and continue to use ES7 decorators. Maybe you've forgotten to do npm install?