ect-mobile-service

A simple service to check if the application is running on a mobile or tablet device

$0

13 downloads
exoduscloudtech

ECT Mobile Service

This library was generated with Angular CLI version 18.0.0.

Description

This is a simple service to check if the application is running on a mobile or tablet device.

Usage

Add the EctMobileService service to your Modules' or AppComponent's Providers list, then 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)

Monetize your
open-source work

Supercharge your OSS projects by selling npm packages. Get started in just 5 minutes.