This is just my opinion, but I think this might be better with less decorators but with decorators that take an optional options object that conform to an interface. For example:
This would be more in line with the way Angular uses decorators and provides a nice way to add additional options to the custom element in the future without introducing new decorators.
The options are themselves optional, so the minimum decorator syntax is:
@CustomElement()
export class MyElement extends Polymer.Element {
name: string;
}
Where the name is inferred from the class name and kebab cased and the template file must match the TypeScript filename.
This is just my opinion, but I think this might be better with less decorators but with decorators that take an optional options object that conform to an interface. For example:
Usage:
This would be more in line with the way Angular uses decorators and provides a nice way to add additional options to the custom element in the future without introducing new decorators.
The options are themselves optional, so the minimum decorator syntax is:
Where the name is inferred from the class name and kebab cased and the template file must match the TypeScript filename.