angular-device-information
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "angular-device-information", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"peerDependencies": { | ||
@@ -21,3 +21,3 @@ "@angular/common": "^9.1.13", | ||
"sideEffects": false, | ||
"description": "<a href=\"https://koderlabs.github.io/ngx-device-detector\"> <h1 align=\"center\">angular-device-detector</h1> </a>", | ||
"description": "<a href=\"#\"> <h1 align=\"center\">angular-device-information</h1> </a>", | ||
"directories": { | ||
@@ -30,4 +30,3 @@ "lib": "lib" | ||
"keywords": [ | ||
"angular", | ||
"device", | ||
"angular-device-information", | ||
"detector", | ||
@@ -47,4 +46,4 @@ "information", | ||
], | ||
"author": "henchiri becher", | ||
"author": "Henchiri Becher", | ||
"license": "ISC" | ||
} |
@@ -1,8 +0,10 @@ | ||
<a href="https://koderlabs.github.io/ngx-device-detector"> | ||
<h1 align="center">angular-device-detector</h1> | ||
<a href="#"> | ||
<h1 align="center">angular-device-information</h1> | ||
</a> | ||
## Dependencies | ||
**Angular-device-information 1.0.0** is available for **Angular 9.x** to **Angular 13.x** | ||
## Installation | ||
@@ -13,6 +15,6 @@ | ||
```bash | ||
$ npm install angular-device-detector --save | ||
$ npm install angular-device-information --save | ||
``` | ||
**In your app.module.ts file add DeviceInformationDetectorService as providers** | ||
**In your app.module.ts file add AngularDeviceInformationService as providers(Optional)** | ||
@@ -25,3 +27,3 @@ ```typescript | ||
import { AppComponent } from './app.component'; | ||
import { DeviceInformationDetectorService } from 'angular-device-detector'; | ||
import { AngularDeviceInformationService } from 'angular-device-information'; | ||
@@ -37,5 +39,5 @@ @NgModule({ | ||
```` | ||
```` | ||
**In your component where you want to use the Device Service** | ||
```typescript | ||
import { Component } from '@angular/core'; | ||
@@ -53,18 +55,17 @@ ... | ||
export class HomeComponent { | ||
deviceInfo = null; | ||
... | ||
constructor(private http: Http, private deviceInformationService: AngularDeviceInformationService) { | ||
console.log(deviceInformationService.isMobile()); // returns if the device is a mobile device (android / iPhone / windows-phone etc) | ||
console.log(deviceInformationService.isTablet()); // returns if the device us a tablet (iPad etc) | ||
console.log(deviceInformationService.isDesktop()); // returns if the app is running on a Desktop browser. | ||
console.log(deviceInformationService.getDeviceType()); // returns if the app is running on a Desktop browser. | ||
console.log(deviceInformationService.getDeviceInfo().os); // returns os name | ||
console.log(deviceInformationService.getDeviceInfo().osVersion); // returns os version | ||
console.log(deviceInformationService.getDeviceInfo().browser); // returns browser name | ||
console.log(deviceInformationService.getDeviceInfo().browserVersion); // returns browser version | ||
console.log(deviceInformationService.getDeviceInfo().browserMajorVersion); // returns full browser version | ||
console.log(deviceInformationService.getDeviceInfo().screen_resolution); // returns screnn size | ||
console.log(deviceInformationService.getDeviceInfo().cookies); // returns cookies enabled or no | ||
console.log(deviceInformationService.getDeviceInfo().userAgent); // returns userAgent | ||
constructor(private deviceInformationService: AngularDeviceInformationService) { | ||
console.log(deviceInformationService.isMobile()); // returns if the device is a mobile device (android / iPhone / windows-phone etc) | ||
console.log(deviceInformationService.isTablet()); // returns if the device is a tablet (tablet iPad etc) | ||
console.log(deviceInformationService.isDesktop()); // returns if the app is running on a Desktop browser. | ||
console.log(deviceInformationService.getDeviceType()); // returns if the app is running on a Desktop browser. | ||
console.log(deviceInformationService.getDeviceInfo().os); // returns os name like Windows/Andtoid/iOS/Linux/Mac OS X etc | ||
console.log(deviceInformationService.getDeviceInfo().osVersion); // returns os version like 10/8.1/7 ...etc | ||
console.log(deviceInformationService.getDeviceInfo().browser); // returns browser name like chrome/firefox ...etc | ||
console.log(deviceInformationService.getDeviceInfo().browserVersion); // returns browser version as number | ||
console.log(deviceInformationService.getDeviceInfo().browserMajorVersion); // returns full browser version as number | ||
console.log(deviceInformationService.getDeviceInfo().screen_resolution); // returns screnn size like 1390x860/640x800 ...etc | ||
console.log(deviceInformationService.getDeviceInfo().cookies); // returns cookies enabled or no | ||
console.log(deviceInformationService.getDeviceInfo().userAgent); // returns userAgent | ||
} | ||
@@ -76,2 +77,4 @@ | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
703262
76