Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
rm-ng-device-detection
Advanced tools
A highly optimized and fully customizable pure angular component for value range selection.
rm-ng-device-detection Library is a powerful tool for detecting and classifying devices in Angular applications. It provides an easy-to-use service that can identify the user's device type (mobile, tablet, desktop), operating system, browser, and more based on the user agent string. This library is designed to help developers tailor user experiences based on device characteristics, enhancing responsiveness and usability.
To install this library, run:
$ npm install rm-ng-device-detection --save
In your component where you want to use the Device Service
import { Component } from '@angular/core';
...
import { RmNgDeviceDetectionService, DeviceInfo } from 'rm-ng-device-detection';
...
@Component({
selector: 'app-root',
standalone: true,
templateUrl: './app.component.html',
styleUrl: './app.component.scss',
})
export class HomeComponent {
deviceInfo: null | DeviceInfo = null;
constructor(private service: RmNgDeviceDetectionService) {
this.getDeviceInfo();
}
...
getDeviceInfo(): void {
this.deviceInfo = this.service.getDeviceInfo();
const isMobile = this.service.isMobile();
const isTablet = this.service.isTablet();
const isDesktop = this.service.isDesktop();
console.log(this.deviceInfo);
console.log(isMobile);
console.log(isTablet);
console.log(isDesktop);
}
...
}
Holds the following properties
Version | Ng |
---|---|
1.x.x | 18.x |
If you identify any errors in this component, or have an idea for an improvement, please open an issue. I am excited to see what the community thinks of this project, and I would love your input!
Are you interested in this library but lacks features? Write to the author, he can do it for you.
The library is inspired by one other library.
Rajat Malik
FAQs
A highly optimized and fully customizable pure angular component for value range selection.
We found that rm-ng-device-detection demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.