Advertisement
Guest User

Untitled

a guest
Jan 21st, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. import {Injectable} from '@angular/core';
  2.  
  3. // Declare TabsService as a provider in app.module.ts
  4. // Inject TabsService in your class: constructor(public tabs: TabsService){}
  5. // Use the this.tabs.hide() or this.tabs.show() methods wherever you want
  6. @Injectable()
  7. export class TabsService {
  8. constructor() {}
  9.  
  10. public hide() {
  11. let tabs = document.querySelectorAll('.tabbar');
  12. if (tabs !== null) {
  13. Object.keys(tabs).map((key) => {
  14. tabs[key].style.transform = 'translateY(56px)';
  15. });
  16. }
  17. }
  18.  
  19. public show() {
  20. let tabs = document.querySelectorAll('.tabbar');
  21. if (tabs !== null) {
  22. Object.keys(tabs).map((key) => {
  23. tabs[key].style.transform = 'translateY(0px)';
  24. });
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement