File

src/app/services/device.service.ts

Accessors

iOS
getiOS()
import { Injectable } from '@angular/core';

@Injectable()
export class DeviceService {
  get iOS(): boolean {
    const iDevices = [
      'iPad Simulator',
      'iPhone Simulator',
      'iPod Simulator',
      'iPad',
      'iPhone',
      'iPod'
    ];

    if (!!navigator.platform) {
      while (iDevices.length) {
        if (navigator.platform === iDevices.pop()) {
          return true;
        }
      }
    }
    return false;
  }
}

results matching ""

    No results matching ""