Getting null when accessing inner element from ons-template. Getting null when document.getElementById('infinite-list') is called from javascript

  • <ons-template id="home.html">
            <div class="left">
              <ons-toolbar-button onclick="">
                <ons-icon icon="ion-navicon, material:md-menu"></ons-icon>
                <div class="center">
                <ons-lazy-repeat id="infinite-list"></ons-lazy-repeat>

  • Onsen UI

    @raju That’s correct. It’s the way ons-template works. I’d recommend using native template element instead since it’s supported from v2.4.0 onwards.

Log in to reply