Ionic2 disable tab item from child

Do you know how can I access a tabcomponent from a child page, in order to disable a tab item from that child.

I found this.navCtrl.parent.select(indexTab) and tried several thing with no success.

Any idea?

Something like this.navCtrl.parent.disable(indexTab) ???

Thank you

Hi Ferminak,

You can disable Tabs using an Attribute [enabled]=“false” in your ion-tab tag.

<ion-tab #contactTab id="contactTab" enabled="false" [root]="tab3Root" tabTitle="Contact" tabIcon="contacts"></ion-tab>.

Even you can add this Attribute from Component using JavaScript setAttribute().

Hi vnyksj,

The tab I want to disable from childpage has now #t2:

<ion-tab [root]=“tab1” tabIcon=“list” [rootParams]=“listParams” >
<ion-tab #t2 [root]=“tab2” tabIcon=“map” [rootParams]=“listaParams”>

So in a childpage I’ve imported:
ViewChild, ElementRef
and declared :
@ViewChild('t2') t2: ElementRef;

And then somewhere in the childpage component I tried:
this.navCtrl.parent.t2.nativeElement.setAttribute('enabled',false);

But I get this error when I try to run the above code:
TypeError: Cannot read property ‘nativeElement’ of undefined(…)

Help! thank you!