Last active
January 9, 2018 07:54
-
-
Save MT--/505a1c385f08fa1b0d6f6f3648ddf582 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Directive } from '@angular/core'; | |
import { ViewController } from 'ionic-angular'; | |
@Directive({ | |
selector: '[hideTabs]' | |
}) | |
export class HideTabsDirective { | |
constructor(private viewCtrl: ViewController) { | |
// hide tabs when view loads | |
this.viewCtrl.didEnter.subscribe(() => { | |
let tabs = document.querySelectorAll('.tabbar'); | |
if ( tabs !== null ) { | |
Object.keys(tabs).map((key) => { | |
tabs[ key ].style.transform = 'translateY(56px)'; | |
}); | |
} // end if | |
}); | |
// show tabs when view exits | |
this.viewCtrl.willLeave.subscribe(() => { | |
let tabs = document.querySelectorAll('.tabbar'); | |
if ( tabs !== null ) { | |
Object.keys(tabs).map((key) => { | |
tabs[ key ].style.transform = 'translateY(0)'; | |
}); | |
} // end if | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey we can use
for of
insteadeg.