| 1 | import { Component, Input, HostBinding } from '@angular/core'; | = | 1 | import { Component, Input, HostBinding } from '@angular/core'; |
| 2 | import { AppService } from '../../app.service'; | 2 | import { AppService } from '../../app.service'; | |
| 3 | import { LayoutService } from '../../layout/layout.service'; | 3 | import { LayoutService } from '../../layout/layout.service'; | |
| 4 | 4 | |||
| 5 | @Component({ | 5 | @Component({ | |
| 6 | selector: 'app-layout-navbar', | 6 | selector: 'app-layout-navbar', | |
| 7 | templateUrl: './layout-navbar.component.html', | 7 | templateUrl: './layout-navbar.component.html', | |
| 8 | styles: [':host { display: block; }'] | 8 | styles: [':host { display: block; }'] | |
| 9 | }) | 9 | }) | |
| 10 | export class LayoutNavbarComponent { | 10 | export class LayoutNavbarComponent { | |
| 11 | isExpanded = false; | 11 | isExpanded = false; | |
| 12 | isRTL: boolean; | 12 | isRTL: boolean; | |
| 13 | 13 | |||
| 14 | @Input() sidenavToggle = true; | 14 | @Input() sidenavToggle = true; | |
| 15 | 15 | |||
| 16 | @HostBinding('class.layout-navbar') hostClassMain = true; | 16 | @HostBinding('class.layout-navbar') hostClassMain = true; | |
| 17 | 17 | |||
| 18 | constructor(private appService: AppService, private layoutService: LayoutService) { | 18 | constructor(private appService: AppService, private layoutService: LayoutService) { | |
| 19 | this.isRTL = appService.isRTL; | 19 | this.isRTL = appService.isRTL; | |
| 20 | } | 20 | } | |
| 21 | 21 | |||
| 22 | currentBg() { | <> | 22 | currentBg(): string { |
| 23 | return `bg-${this.appService.layoutNavbarBg}`; | = | 23 | return `bg-${this.appService.layoutNavbarBg}`; |
| 24 | } | 24 | } | |
| 25 | 25 | |||
| 26 | toggleSidenav() { | <> | 26 | toggleSidenav(): void { |
| 27 | this.layoutService.toggleCollapsed(); | = | 27 | this.layoutService.toggleCollapsed(); |
| 28 | } | 28 | } | |
| 29 | } | 29 | } |