Wouldn't it be nicer to have something like this:
@Component({
selector: 'comp'
})
@View({
template: ''
})
export default class Comp {
@Property({expression: '[attr.test]'})
set testProp(value: string) {}
@Event({name: 'click', stopPropagation: false})
onClick(event: MouseEvent) {}
}
Rather than this:
@Component({
selector: 'comp',
host: {
'(click)': 'onClick($event)',
'[attr.test]': 'testProp'
}
})
@View({
template: ''
})
export default class Comp {
testProp: string;
onClick(event: MouseEvent) {}
}
I know it's gonna be a bit different than working in a template but don't you think this is much more convenient?