本文整理汇总了TypeScript中ionic-angular.Platform类的典型用法代码示例。如果您正苦于以下问题:TypeScript Platform类的具体用法?TypeScript Platform怎么用?TypeScript Platform使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Platform类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(nav:NavController, platform:Platform) {
this.nav = nav;
platform.ready().then(() => {
});
}
示例2: constructor
constructor(platform: Platform)
{
this.policy = "Privacy policy";
this.policyURL = "https://s3.priority-software.com/terms/master_privacy_policy.pdf";
if (platform.is("ios"))
this.termsURL = "https://s3.priority-software.com/terms/master_termsofuse_appstore.pdf";
else
this.termsURL = "https://s3.priority-software.com/terms/master_termsofuse_googleplay.pdf";
}
示例3: show
show(message = '') {
if (this.platform.is('cordova')) {
this.toastNative.show(message, `${TOAST_DURATION}`, this.config.getToast('position', TOAST_POSITION)).subscribe();
} else {
this.toastCtrl.create({
message,
duration: this.config.getToast('duration', TOAST_DURATION)
}).present();
}
}
示例4: if
/**
* opens the url with the system app if installed or in the browser
* @param url url of the website
*/
openYouTube(url) {
let app;
if (this.platform.is('ios')) {
app = 'youtube://';
}
else if (this.platform.is('android')) {
app = 'com.google.android.youtube';
}
AppAvailability.check(app).then(
function () { // Success callback
open(url, '_system', 'location=no');
console.log('YouTube is available');
},
function () { // Error callback
open(url, '_system', 'location=no');
console.log('YouTube is not available');
});
}
示例5: initializeApp
private initializeApp(): void {
this.platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
// https://github.com/lathonez/clicker/issues/148#issuecomment-254436635
// StatusBar.styleDefault();
console.log('production: ' + environment.production);
});
}
示例6: ngOnInit
ngOnInit() {
//console.dir(this.el.nativeElement.attributes);
if(this.color === 'light' && this.platform.is('ios')){
this.color = 'primary'
this.el.nativeElement.style.color = `var(--color-${this.color})`;
}else{
this.el.nativeElement.style.color = `var(--color-${this.color})`;
}
}
示例7: createDeleteButton
createDeleteButton(message, handler) {
return {
text: this.translate.instant(message),
role: 'destructive',
icon: !this.platform.is('ios') ? 'trash' : null,
cssClass: 'WorkoutAction-delete',
handler
}
}
示例8: initializeApp
initializeApp() {
this.platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
StatusBar.styleDefault();
//Initialize facebook
this.authProvider.initFacebook();
});
}