Skip to content

Can't use PimpedNodeList on NodeListOf #388

Closed
@avernet

Description

@avernet

Following the instructions on From ES6 to Scala: Advanced, I do:

val images = dom.document.querySelectorAll("img").asInstanceOf[NodeListOf[HTMLImageElement]]
images.map(_.src)

The second line doesn't compile, and the compiler tells us: value map is not a member of org.scalajs.dom.NodeListOf[org.scalajs.dom.raw.HTMLImageElement]. If I import org.scalajs.dom.ext._, I'd expect my NodeListOf to be "pimped", but apparently PimpedNodeList only applies on NodeList, and not on NodeListOf. You can try this in this scastie.

Am I missing something, or is there something incorrect in the documentation? (Or both!)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions