Package Exports
- ngx-device-info
- ngx-device-info/package.json
Readme

Device detector / Device info
Angular library which provides device information / type / name and also it provides much more device independent features & informations.
Get device information and more
Import
Import the module on your app.module.ts
file as follow.
import { NgxDeviceInfoModule} from "ngx-device-info";
Using service
Import the servie to appropriate component / service file as follows.
import { NgxDeviceInfoService } from 'ngx-device-info';
constructor( public device: NgxDeviceInfoService ) {
// this.device. yourmethod()
}
Methods
Methods | usage | |
---|---|---|
getDeviceName() | returns device specific name |
|
isDesktop() | returns true if decice is desktop |
|
isMobile() | returns true if decice is mobile |
|
isTablet() | returns true if decice is tablet |
|
getDeviceType() | returns device type mobile - tablet - desktop |
|
getDeviceInfo() | returns object of info | |
deviceName | returns device name |
|
deviceType | returns device type |
|
userAgent | returns userAgent |
|
language | returns device language | |
isOnline | returns whether internet is on - off |
|
cookieEnabled | checks is cookieEnabled |
|
vendor | returns vendor info |
|
permissions | returns permissions object |
|
href | returns location - href |
|
protocol | returns location - protocol |
|
host | returns location - host |
|
hostname | returns location - hostname |
|
pathname | returns location - pathname |
|
search | returns location - search |
|
hash | returns location - hash |
|
origin | returns location - origin |
|
timeZoneOffSet | returns date- timeZoneOffSet |
|
utcString | returns date- utcString |
|
time | returns date- time |
|
date | returns date- date |
|
day | returns date- day |
|
month | returns date- month |
|
hour | returns date- hour |
|
year | returns date- year |
|
seconds | returns date- seconds |
|
milliseconds | returns date- milliseconds |
|
utcdate | returns date- utcdate |
|
utcday | returns date- utcday |
|
utcmonth | returns date- utcmonth |
|
utcyear | returns date- utcyear |
CDN
CDN Link for ngx-array- https://unpkg.com/ngx-device-info@0.0.5/bundles/ngx-device-info.umd.js
Angular version
This library was generated with Angular CLI version 13.0.0.
Code integration
To use this package as a service npm i ngx-device-info
install this on the root angular project .
Note: Don't forget to run this commend
npm i ngx-device-info
on root folder or else it will throw error.
Then import the module as follow on imports array
NgxDeviceInfoModule
Author
Thanks in advance
Coimbatore