TypeScript 2.1 Apparently now has support for writing custom html elements ("What's new in TypeScript - 2.1")
However I have been unable to find any documentation on how this is supposed to work.
Can anyone provide an explanation on how this is supposed to work, ideally with examples?
Thank You
Currently this is not possible, when targeting ES5 with TypeScript. The Custom Elements API V1 needs ES6/ES2015-style classes. However if you target ES5 with TypeScript (for compatibility with IE 11 for example) all classes get transpiled to functions.
This is not a TypeScript limitation, but a limitation of the Custom Elements API V1 itself.
You have two options:
The release notes for TypeScript 2.1 are misleading; it is not a TypeScript issue at all. See this issue for more background.