-
Notifications
You must be signed in to change notification settings - Fork 99
Description
PR: #315
const data: DocumentFragment = ...
const template = window.document.createElement('template') as HTMLTemplateElement;
template.content.append(data);
console.log('innerHTML:', template.innerHTML, 'children:',Array.from(template.content.children)); // innerHTML emptyStringnot working..
innerHTML output is empty string
console.log('innerHTML:', template.innerHTML, 'children:',Array.from(template.content.children));--log result--
innerHTML: children: [
<ref *1> HTMLStyleElement {
ownerDocument: HTMLDocument {
ownerDocument: null,
localName: '#document',
nodeType: 9,
parentNode: null,
[Symbol(next)]: [DocumentType],
[Symbol(prev)]: null,
[Symbol(private)]: null,
[Symbol(end)]: [Object],
[Symbol(CustomElements)]: [Object],
[Symbol(MutationObserver)]: [Object],
[Symbol(mime)]: [Object],
[Symbol(doctype)]: [DocumentType],
[Symbol(DOMParser)]: [class DOMParser],
[Symbol(globals)]: null,
[Symbol(image)]: null,
[Symbol(upgrade)]: null,
[Symbol(EventTarget)]: [DOMEventTarget]
},
localName: 'style',
nodeType: 1,
parentNode: DocumentFragment {
ownerDocument: [HTMLDocument],
localName: '#document-fragment',
nodeType: 11,
parentNode: null,
[Symbol(next)]: [Circular *1],
[Symbol(prev)]: null,
[Symbol(private)]: [HTMLTemplateElement],
[Symbol(end)]: [Object]
},
[Symbol(next)]: Attr {
ownerDocument: [HTMLDocument],
localName: 'id',
nodeType: 2,
parentNode: null,
ownerElement: [Circular *1],
name: 'id',
[Symbol(next)]: [Attr],
[Symbol(prev)]: [Circular *1],
[Symbol(value)]: 'KQykvzSaQPUDomNDyYpuZNdcxkWCkvHtGvVujfjH-style',
[Symbol(changed)]: false
},
[Symbol(prev)]: DocumentFragment {
ownerDocument: [HTMLDocument],
localName: '#document-fragment',
nodeType: 11,
parentNode: null,
[Symbol(next)]: [Circular *1],
[Symbol(prev)]: null,
[Symbol(private)]: [HTMLTemplateElement],
[Symbol(end)]: [Object]
},
[Symbol(private)]: null,
[Symbol(end)]: {
nodeType: -1,
ownerDocument: [HTMLDocument],
parentNode: null,
[Symbol(next)]: [HTMLElement],
[Symbol(prev)]: [Attr],
[Symbol(start)]: [Circular *1]
},
...
]
I was thus treated with innerHTML.
- template.innerHTM; .. template.content
But I think it needs to be fixed