Notice: The Monaca & Onsen UI Community Forum is shutting down.

For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.

Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.

Rendering a template for every element in a data stream - Infinite Lists

  • I have a stream of data which I want to display in a list. As the title shows, I want to render a template for every element in my data. Basically like the Twitter Interface tutorial but with a stream of incoming data.
    I see that one-lazy-repeat takes a template but how can I use delegate to modify the contents of this template with the data? Thank you

       <ons-lazy-repeat id="infinite-list">
           <p id="title"> </p>
           <img id="post_img" />
           <p id="author"> </p>

  • Onsen UI

    @Dipanshu-Juneja The template is passed on the second argument to createItemContent function. However, it’s an html element, not a string. A better way would be using ons.createElement('<ons-list-item>' + content + '</ons-list-item>') in createItemContent.