本文整理汇总了TypeScript中connectivity.getConnectionType函数的典型用法代码示例。如果您正苦于以下问题:TypeScript getConnectionType函数的具体用法?TypeScript getConnectionType怎么用?TypeScript getConnectionType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getConnectionType函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor() {
this.deviceInformation = new DeviceInfo(
device.model,
device.deviceType,
device.os,
device.osVersion,
device.sdkVersion,
device.language,
device.manufacturer,
device.uuid
);
this.screenInformation = new ScreenInfo(
screen.mainScreen.heightDIPs,
screen.mainScreen.heightPixels,
screen.mainScreen.scale,
screen.mainScreen.widthDIPs,
screen.mainScreen.widthPixels
);
let connectionType = connectivity.getConnectionType();
switch (connectionType) {
case connectivity.connectionType.none:
this.connectionType = "None";
break;
case connectivity.connectionType.wifi:
this.connectionType = "Wi-Fi";
break;
case connectivity.connectionType.mobile:
this.connectionType = "Mobile";
break;
default:
break;
}
}
示例2: constructor
constructor(private zone: NgZone) {
// >> connectivity-gettype-code
let connectionType = connectivity.getConnectionType();
switch (connectionType) {
case connectivity.connectionType.none:
this.connectionType = "None";
break;
case connectivity.connectionType.wifi:
this.connectionType = "Wi-Fi";
break;
case connectivity.connectionType.mobile:
this.connectionType = "Mobile";
break;
default:
break;
}
// << connectivity-gettype-code
}
示例3: getConnectionType
/**
* Get connection type.
*/
public getConnectionType(): ConnectionType {
return getConnectionType();
}
示例4: constructor
constructor(private router: RouterExtensions) {
this.currentConnectionType = new BehaviorSubject<ConnectionType>(getConnectionType());
}