這個 Platform 不需要去修改 /src/app/app.module.ts 檔,直接加到 constructor
裡就可以被使用。
URL:https://ionicframework.com/docs/api/platform/Platform/
Platform
The Platform service can be used to get information about your current device. You can get all of the platforms associated with the device using the platformsmethod, including whether the app is being viewed from a tablet, if it’s on a mobile device or browser, and the exact platform (iOS, Android, etc). You can also get the orientation of the device, if it uses right-to-left language direction, and much much more. With this information you can completely customize your app to fit any device.
Usage
import { Platform } from 'ionic-angular';
@Component({...})
export MyPage {
constructor(public plt: Platform) {
}
}