Migrated remaining components to custom device detector service
This commit is contained in:
1 parent
1de9fee912
commit
0221f053db
2 files changed
+6
-6
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {DeviceDetectorService} from 'ngx-device-detector';
|
||||
import {DeviceDetectorService} from '../services/device-detector.service';
|
||||
|
||||
import {NavigationEnd, Router, RouterLink} from '@angular/router';
|
||||
import {TranslatePipe, TranslateService} from '@ngx-translate/core';
|
||||
@@ -17,7 +17,7 @@ import {TranslatePipe, TranslateService} from '@ngx-translate/core';
|
||||
export class MobileNavbarComponent implements OnInit{
|
||||
currentLang: string;
|
||||
menuOpen = false;
|
||||
isMobile: boolean;
|
||||
isMobile: boolean = false;
|
||||
activeLink: string = '';
|
||||
|
||||
constructor(
|
||||
@@ -25,7 +25,7 @@ export class MobileNavbarComponent implements OnInit{
|
||||
private deviceService: DeviceDetectorService,
|
||||
private translate: TranslateService
|
||||
) {
|
||||
this.isMobile = this.deviceService.isMobile();
|
||||
this.isMobile = this.deviceService.isMobile;
|
||||
this.currentLang = this.translate.currentLang || this.translate.getDefaultLang() || 'en';
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {NavigationEnd, Router, RouterLink} from '@angular/router';
|
||||
import {DeviceDetectorService} from 'ngx-device-detector';
|
||||
import {DeviceDetectorService} from '../services/device-detector.service';
|
||||
import {filter} from 'rxjs/operators';
|
||||
import {TranslatePipe, TranslateService} from '@ngx-translate/core';
|
||||
|
||||
@@ -16,14 +16,14 @@ import {TranslatePipe, TranslateService} from '@ngx-translate/core';
|
||||
export class NavbarComponent implements OnInit {
|
||||
currentLang: string;
|
||||
activeLink: string = '';
|
||||
isMobile: boolean;
|
||||
isMobile: boolean = false;
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private deviceService: DeviceDetectorService,
|
||||
private translate: TranslateService
|
||||
) {
|
||||
this.isMobile = this.deviceService.isMobile();
|
||||
this.isMobile = this.deviceService.isMobile;
|
||||
this.currentLang = this.translate.currentLang || this.translate.getDefaultLang() || 'en';
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user