src/app/services/device.service.ts
iOS |
getiOS()
|
Defined in src/app/services/device.service.ts:5
|
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;
}
}