I have a page that lists some items, and when the user clicks one of them it opens a tabs page with 4 tabs. I don’t want each tab to reload the content every time I re-click on one of them.
Actually if I click on tab 2, then tab 4, when I come back on tab 2, it reloads (redownload, which consume unnecessary internet data). I don’t want tab 2 to be reloaded, I just want that tab to show the previous downloaded content.
depends on how you use the tabs. if you are using the tab to display some page contents which have you been using tabs to show different pages or different contents in same page?
if you are using the tab to display some page contents you might wanna remove any function/API calls made on ionviewwillenter method
or if you you wanna display contents of the same page with tabs just use *ngIf to show contents
pardon me if I have understood your problem in the wrong direction
1 Like
As @MOHANTHANGARAJ is suggesting, don’t do heavy things in lifecycle event handlers. The only thing you should be doing there is getting the component into a sane state in ways that cannot be done in the constuctor for technical reasons.
1 Like