ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

ng-if is not working on tabs or tab-item

Open D3CK3R opened this issue 12 years ago • 6 comments

When i try to hide a tab the tabs are somehow broken if the hidden tab gets visible. The hidden tab will show up at the end, not at its defined position. (ng-show is also not working)

D3CK3R avatar Apr 22 '14 12:04 D3CK3R

I think I see what you mean.

This is why we still need a separate element for tab navigation. We've gone over this like three times and decided against it, but problems keep coming up!

@adamdbradley @mlynch we could do a backwards-compatible change and just deprecate all of the attributes on ion-tab?

The below is verbose, but literally 100% flexible and allows people to do anything they want. The current way does not.

<ion-tab>
  <ion-tab-nav ng-if="shouldShow()">
    Tab Title
  </ion-tab-nav>
  <ion-tab-content>
    Tab Content
  <ion-tab-content>
</ion-tab>

ajoslin avatar Apr 25 '14 14:04 ajoslin

Yes we've been over this numerous times, but we had reasons and agreed not to do ionTabNav, but I've already forgotten why (We should document the reasons for not doing so). If I recall the added elements made things much more confusing and really didn't solve any issues.

adamdbradley avatar Apr 28 '14 17:04 adamdbradley

We've been over it a few times, but it does keep coming up.

We ditched it because it seemed too verbose/ugly - but verbose is not always bad if it affords the developer more power.

We should open a document to figure it out.

ajoslin avatar Apr 28 '14 18:04 ajoslin

I got the order to remain the same by using ng-if="true" on the other tabs (the ones you aren't hiding) but I'm not sure if it's a work around for the other problems.

cory-buckley avatar May 27 '14 20:05 cory-buckley

Moving feature requests from GH Issues to Trello. Please continue the discussion and vote for this and other issues that are important to you

https://trello.com/b/nNk2Yq1k/ionic-framework

mhartington avatar Jul 28 '14 21:07 mhartington

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Sep 06 '18 12:09 ionitron-bot[bot]