Skip to content

How addEventListener in nested template? #1250

Description

@oswaldofreitas

Please, see the following link for details:
http://stackoverflow.com/questions/28838190/how-addeventlistener-in-nested-template

The question is: WHEN (in which event) should I use querySelectorAll() to get my forms that are inside a second/nested template (first is "#app"). Array length is returning zero.

Activity

  1. oswaldofreitas commented on Mar 3, 2015

    @oswaldofreitas
    Author
    app.addEventListener('template-bound', function() {
        var template2 = app.$.template2;
        var forms = template2.querySelectorAll('.teste');
        console.log(template2); <== ok (HTMLTemplateElement)
        console.log(forms.length); <== issue (0)
    });
    
  2. oswaldofreitas commented on Mar 4, 2015

    @oswaldofreitas
    Author

    Question answered on stackoverflow, marking as closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions