ionic添加cordova插件-Device

gzgchzc博客最新更新地址:http://blog.gzvtc.cc/

Device
获取设备相关信息,如平台、设备模型。

cordova plugin add cordova-plugin-device

Example

module.controller('MyCtrl', function($scope, $cordovaDevice) {

  document.addEventListener("deviceready", function () {

    var device = $cordovaDevice.getDevice();

    var cordova = $cordovaDevice.getCordova();

    var model = $cordovaDevice.getModel();

    var platform = $cordovaDevice.getPlatform();

    var uuid = $cordovaDevice.getUUID();

    var version = $cordovaDevice.getVersion();

  }, false);
})
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页