0

Onsen UI: v2.0.1

AngularJS: 1.5.9

I am building an Android and IOS application that requires dynamic tabs (ons-tab) like in native applications. The content in each tabs can be up to a hundred items. So I want to use ons-lazy-repeat for the ons-tab content to minimize memory consumptions. How do I go about achieving this (dynamic tabs and ons-lazy-repeat ) with Onsen UI. I have searched online and I couldn’t see any solution.

Thank you!

1 Answers1

0

The ons-lazy-repeat component is described in detail in the documentation.

Dynamic tabs can easily be achieved by using the ng-repeat clause of AngularJS. If you don't want to load the content of each tab right at the beginning, you have multiple options like ng-if or ng-include to make sure that only the content of the current visible tab is loaded. You may access and check the visibility of the $index variable that is available in the ng-repeats scope to do so.

See this post how this may be done. Onsen offers a tabbar and tab components which will work the same way as the tab div's in the questions answer.

Community
  • 1
  • 1
bentrm
  • 1,018
  • 3
  • 10
  • 26