Hi!
Im having a weird issue of a black screen when I navigate to a tabs component, gif for better explanation:
The screens shows after a couple of clicks.
Basically what i did was this:
tabs.html:
<ion-tabs>
<ion-tab [root]="tab.component" *ngFor="let tab of tabs" [rootParams]="data" tabTitle="{{ tab.name }}"></ion-tab>
</ion-tabs>
tabs.ts:
constructor(
navParams: NavParams
) {
this.mySelectedIndex = navParams.data.tabIndex || 0;
this.user = authService.getUser();
if(this.user.type = "user"){
this.setUserTabs();
}else{
this.setClientTabs();
}
private setUserTabs() {
this.tabs = [
{
name: 'Pending',
component: JobsPending
},
{
name: 'Confirmed',
component: JobsConfirmed
},
{
name: 'Complete',
component: JobsDone
},
];
}
private setClientTabs(){
this.tabs = [
{
name: 'Confirmados',
component: JobsConfirmed
},
{
name: 'Pendientes',
component: JobsPending
},
{
name: 'Completados',
component: JobsDone
}
];
}
Anyone had this issue before? Or thinks that my approach of “dynamic” tabs is not the right way to go?
Thanks!