TypeScript Version: 2.5.3
Code:
let tmpl = document.querySelector('template'),
host = document.getElementById('host-container');
let myRoot = host.createShadowRoot();
myRoot.appendChild(document.importNode(tmpl.content, true));
console:
: error TS2339: Property 'createShadowRoot' does not exist on type 'HTMLElement'.
when i change main.ts >> main.js
Everything works fine, that's reason why i make this topic.
_Maybe i did something wrong, so don't judge too hard :smile:_
Duplicate of #10401
The Shadow DOM currently has limited browser support, therefore it not included in the libraries included with TypeScript. You will either have to create them yourself or acquire them somewhere.
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
What's your threshold for browser support that merits inclusion?
We have lowered the bar recently to allow experimental APIs. That said I am hoping that we would get this for free the next time we update our drop of the edge鈥檚 webidl