When using tagless components (tagName = ""
), the element
property is (understandably) null
. However I’d like to access some child node, which is usually done through this.element.querySelector(...)
. Is there a similar API available for tagless components?
import Component from '@ember/component';
import { action } from "@ember/object";
export default class extends Component {
tagName = "";
@action actionName() {
this.element.querySelector(".class")
// this.element is null, how to get child node here?
}
}
5 posts - 2 participants