ect-mobile-service
v1.21.0
Published
A simple service to check if the application is running on a mobile or tablet device
Readme
ECT Mobile Service
This library was generated with Angular CLI version 21.0.1.
Description
This is a simple service to check if the application is running on a mobile or tablet device.
Usage
If you are using non-standalone components, add the EctMobileService to your Modules' or AppComponent's Providers list. If using standalone components, this last sentence can be skipped. Inject the service into the constructor of your class.
For example:
import { Component } from '@angular/core';
import { EctMobileService } from 'ect-mobile-service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ],
providers: [ EctMobileService ]
})
export class AppComponent {
public isMobile: boolean;
constructor(private mobileService: EctMobileService) {
this.isMobile = this.mobileService.isMobileDevice();
}
}Functions
- isMobileDevice: Function returns true if the current device is identified as a mobile/smartphone sized device
- isSmallScreenDeviceButNotMobile: Function returns true if the current device is identified as a tablet sized device
Dependencies
None
Cost
If you find some benefit from using this package, please consider the time it took to put this together, and why not buy me a coffee? Goodness only knows that most of us would not function without coffee. All donations very much welcomed: (https://www.buymeacoffee.com/exoduscloudtech)
Further help
To get more help on the this ECT Mobile Service, please visit (https://angular-grid.net/free/ect-mobile-service)
