Loading...

Which interface type should I choose the in angular


    let mdNode = document.querySelector('#test')

    let targetNode: HTMLElement = <HTMLElement>Array.from(mdNode.childNodes).find(childNode => {
      if (childNode.nodeType === 1) {
        return childNode.innerHTML.indexOf('aaaa') !== -1
      }
    })

It tips error TS2339: Property 'innerHTML' does not exist on type 'ChildNode'.

The nodeType === 3 dose haven't innerHTML property, but the nodeType ===1 have the innerHTML. What should I change to fix this error.

- - Source
comments powered by Disqus