I’m creating an app in which I have multiple pages with over 1000+ lines of HTML code. I have few with 10000 lines or so.
I used LazyLoading so that app is initialising pretty fast. But when I enter those pages I have a lag. The app stalls and take like 10-20 seconds to navigate to those pages.
I tried to use “priority” for the pages, but If I do that I have a lag on the app initialisation - so this is not a solution for me.
I see that InfiniteScroll requires a list to parse when scrolling. Is this still doable without having something to parse iteratively? I have HTML code which cannot be simply put in lists as this: (this is the code from the Ionic Docs).
items = [];
constructor() {
for (let i = 0; i < 30; i++) {
this.items.push( this.items.length );
}
}
doInfinite(infiniteScroll) {
console.log('Begin async operation');
setTimeout(() => {
for (let i = 0; i < 30; i++) {
this.items.push( this.items.length );
}
console.log('Async operation has ended');
infiniteScroll.complete();
}, 500);
}
I do not know the details of your project, but …
…if you have HTML files with 10000 lines, you might have to consider changing the UI of your application.
Can you divide the content of these pages into different sub-pages?
Should the user make a lot of scroll?
I know it is not the solution but maybe can help you.