本文整理匯總了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();
});
}