I have a tab like this:
<ion-tabs tabs-style='tabs-icon-top' tabs-type='tabs-default'>
<!-- Pets Tab -->
<ion-tab href='#/tab/pets' icon='icon ion-home' title='Pets'>
<ion-nav-view name='pets-tab'></ion-nav-view>
</ion-tab>
<!-- Adopt Tab -->
<span ng-show='user()'>
<ion-tab href='#/tab/adopt' icon='icon ion-heart' title='Adopt'>
<ion-nav-view name='adopt-tab'></ion-nav-view>
</ion-tab>
<ion-tab href='#/tab/about' icon='icon ion-search' title='About'>
<ion-nav-view name='about-tab'></ion-nav-view>
</ion-tab>
</span>
<!-- Sign In Tab -->
<span ng-show='!user()'>
<ion-tab href='#/tab/sign-in' icon='icon ion-person' title='Sign In'>
<ion-nav-view name='sign-in-tab'></ion-nav-view>
</ion-tab>
</span>
</ion-tabs>
When I change my variable so that user() evaluated from an object to null or vice versal, an error happened in background:
TypeError: Cannot call method 'querySelectorAll' of undefined
at cancelChildAnimations (http://localhost:5000/lib/js/angular/angular-animate.js:878:22)
at Object.leave (http://localhost:5000/lib/js/angular/angular-animate.js:442:11)
at Object.ngIfWatchAction [as fn] (http://localhost:5000/lib/js/angular/angular.js:18503:24)
at Scope.$digest (http://localhost:5000/lib/js/angular/angular.js:11830:29)
at Scope.$apply (http://localhost:5000/lib/js/angular/angular.js:12083:24)
at HTMLAnchorElement.<anonymous> (http://localhost:5000/lib/js/ionic-angular.js:2851:15)
at http://localhost:5000/lib/js/angular/angular.js:2616:10
at forEach (http://localhost:5000/lib/js/angular/angular.js:310:20)
at HTMLAnchorElement.eventHandler (http://localhost:5000/lib/js/angular/angular.js:2615:5)
at Object.ionic.tapElement (http://localhost:5000/lib/js/ionic.js:2114:9) angular.js:9435
May be I did something wrong? My intention is to show/hide certain tab at one moment only. What’s the correct way to do so?