Guest User

Untitled

a guest
Apr 25th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. import { Component, Input, OnInit } from '@angular/core';
  2.  
  3. import { NbMenuService, NbSidebarService } from '@nebular/theme';
  4. import { UserService } from '../../../@core/data/users.service';
  5. import { AnalyticsService } from '../../../@core/utils/analytics.service';
  6.  
  7. @Component({
  8. selector: 'ngx-header',
  9. styleUrls: ['./header.component.scss'],
  10. templateUrl: './header.component.html',
  11. })
  12. export class HeaderComponent implements OnInit {
  13.  
  14.  
  15. @Input() position = 'normal';
  16.  
  17. user: any;
  18.  
  19. userMenu = [{ title: 'Profile' }, { title: 'Log out' }];
  20.  
  21. constructor(private sidebarService: NbSidebarService,
  22. private menuService: NbMenuService,
  23. private userService: UserService,
  24. private analyticsService: AnalyticsService) {
  25. }
  26.  
  27. ngOnInit() {
  28. this.userService.getUsers()
  29. .subscribe((users: any) => this.user = users.nick);
  30. }
  31.  
  32. toggleSidebar(): boolean {
  33. this.sidebarService.toggle(true, 'menu-sidebar');
  34. return false;
  35. }
  36.  
  37. toggleSettings(): boolean {
  38. this.sidebarService.toggle(false, 'settings-sidebar');
  39. return false;
  40. }
  41.  
  42. goToHome() {
  43. this.menuService.navigateHome();
  44. }
  45.  
  46. startSearch() {
  47. this.analyticsService.trackEvent('startSearch');
  48. }
  49. }
Add Comment
Please, Sign In to add comment