angular get device information
npm install ngx-device-detector
angular get device information
npm install ngx-device-detector
angular get device information
import { Component, VERSION } from "@angular/core";
import { DeviceDetectorService } from "ngx-device-detector";
@Component({
selector: "my-app",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.css"]
})
export class AppComponent {
name = "Angular " + VERSION.major;
deviceInfo = null;
isDesktopDevice: boolean;
isTablet: boolean;
isMobile: boolean;
constructor(private deviceService: DeviceDetectorService) {
this.epicFunction();
}
epicFunction() {
this.deviceInfo = this.deviceService.getDeviceInfo();
this.isMobile = this.deviceService.isMobile();
this.isTablet = this.deviceService.isTablet();
this.isDesktopDevice = this.deviceService.isDesktop();
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us