本文整理汇总了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;
}
}
开发者ID:sandy100,项目名称:Coursera,代码行数:35,代码来源:platform.service.ts
示例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
}
开发者ID:aymenbraiek,项目名称:nativescript-sdk-examples-ng,代码行数:18,代码来源:using-connectivity.component.ts
示例3: getConnectionType
/**
* Get connection type.
*/
public getConnectionType(): ConnectionType {
return getConnectionType();
}
开发者ID:racketometer,项目名称:frontend-application,代码行数:6,代码来源:connectivity.service.ts
示例4: constructor
constructor(private router: RouterExtensions) {
this.currentConnectionType = new BehaviorSubject<ConnectionType>(getConnectionType());
}
开发者ID:TheOriginalJosh,项目名称:nativescript-weather,代码行数:3,代码来源:connection.service.ts
注:本文中的connectivity.getConnectionType函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论