How to NOT init all tabitems when itemview init?



My code is like (with wrapped in app component):

          <TabView class="tab-view" androidTabsPosition="bottom">
            <StackLayout *tabItem="{iconSource: getIconSource('home')}">
            <StackLayout *tabItem="{iconSource: getIconSource('browse')}">
            <StackLayout *tabItem="{iconSource: getIconSource('search') }">
            <StackLayout *tabItem="{iconSource: getIconSource('browse') }">

How to NOT init all tabitem when itemview init?
Currently, all tabitem (home-tab, moment-tab, contact-tab…) called ngOnInit and ngAfterViewInit event once enter tab.
Such behavior drastically slow the performance as I have some complex UI in and .
Is there any way to lazy init moment-tab, contact-tab… when I actually tapped the tabitem?


It should not be an issue. Even though your component is initialised (calls onInit etc.,), it actually be rendered only when you reach that tab.

You may listen for loaded event of root view in that component to verify that.