Tabview detect user interaction


#1

Hi I’m building NS angular2 app I encounter a problem with default behavior of TabView component I don’t want it to pre-load all data when component is created… how can I prevent this behavior to happening. I only want to load data for certain tab once user click on it…

Here is my tabview:

<TabView  #tabview (selectedIndexChange)="onIndexChanged($event)" class="tab-view" sdkToggleNavButton> 
    <StackLayout *tabItem="{title: 'Summary', iconSource: 'res://ic_summary'}" >
        <summary></summary>
    </StackLayout>
    <StackLayout *tabItem="{title: 'Dash', iconSource: 'res://ic_dashboard'}">
            <dashboard></dashboard>
    </StackLayout>
    <StackLayout *tabItem="{title: 'My players', iconSource: 'res://ic_players'}" >  
        <myplayers></myplayers>
    </StackLayout>
    <StackLayout *tabItem="{title: 'Details', iconSource: 'res://ic_details'}" > 
        <playerdetails></playerdetails>
    </StackLayout>
</TabView>

I am able to get onIndexChanged event invoked in the same .ts of tabview, however I HAVE to notify summary, dashboard, inner components.

Example of component that needs to be notified:

@Component({
  selector: "summary",
  templateUrl: 'summary.component.html'
})
export class SummaryView extends View {
  
    constructor(args:Page){
       super();
    }
}

#2

Hey, I’m facing the EXACTLY same problem. I can’t find a way to resolve this yet.