Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4826

Access to child element in tagless component

$
0
0

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

Read full topic


Viewing all articles
Browse latest Browse all 4826

Trending Articles