本文整理汇总了TypeScript中ionic-angular.Events.publish方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Events.publish方法的具体用法?TypeScript Events.publish怎么用?TypeScript Events.publish使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ionic-angular.Events
的用法示例。
在下文中一共展示了Events.publish方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: handlePayPro
private handlePayPro(payProDetails, url, coin?: Coin): void {
if (!payProDetails) {
this.logger.error('No wallets available');
const error = this.translate.instant('No wallets available');
this.events.publish('incomingDataError', error);
return;
}
const stateParams = {
amount: payProDetails.amount,
toAddress: payProDetails.toAddress,
description: payProDetails.memo,
paypro: payProDetails,
coin,
payProUrl: url,
requiredFeeRate: payProDetails.requiredFeeRate
? Math.ceil(payProDetails.requiredFeeRate * 1024)
: undefined
};
const nextView = {
name: 'ConfirmPage',
params: stateParams
};
this.events.publish('IncomingDataRedir', nextView);
}
示例2:
this.auth.onAuthStateChanged((user: any) => {
if (user) {
this.events.publish('user:login');
} else {
events.publish('user:logout');
}
});
示例3: goSend
private goSend(
addr: string,
amount: string,
message: string,
coin: Coin
): void {
if (amount) {
let stateParams = {
amount,
toAddress: addr,
description: message,
coin
};
let nextView = {
name: 'ConfirmPage',
params: stateParams
};
this.events.publish('IncomingDataRedir', nextView);
} else {
let stateParams = {
toAddress: addr,
description: message,
coin
};
let nextView = {
name: 'AmountPage',
params: stateParams
};
this.events.publish('IncomingDataRedir', nextView);
}
}
示例4: Uint16Array
this.liveStepSubscription.subscribe(buffer => {
let data = new Uint16Array(buffer);
this.events.publish('steps',data[0]);
/* For total steps, calculate how many steps to add as the current
step count minues the previous */
this.totalSteps += (data[0] - this.lastStepCount);
this.lastStepCount = data[0];
this.events.publish('totalsteps',this.totalSteps);
});
示例5: selectCity
selectCity(index, area) {
if (typeof index === 'number') {
if (!area) {
this.province = this.locales[index].name;
this.citys = this.locales[index].city;
if (this.citys.length === 1) {
this.area = this.citys[0].area;
}
} else {
this.city = this.citys[index].name;
this.area = this.citys[index].area;
}
this.nav.push(LocaleSelectPage, { province: this.province, city: this.city, citys: this.citys, area: this.area });
} else if (typeof index === 'string') {
let locale = {
province: this.province,
city: this.city || this.province,
district: index,
str: this.province
};
let backIndex = 0;
if (this.city) {
backIndex = this.view.index - 3;
} else {
backIndex = this.view.index - 2;
}
locale.str = locale.city + ' ' + locale.district;
this.nav.popTo(this.nav.getByIndex(backIndex));
this.events.publish('select:locale', locale);
}
}
示例6: backdropDismiss
public backdropDismiss(): void {
this.events.publish('selectWalletEvent');
this.showSlideEffect = false;
setTimeout(() => {
this.showWalletsSelector = false;
}, 150);
}
示例7: selectWallet
public selectWallet(wallet: any): void {
this.events.publish('selectWalletEvent', wallet);
this.showSlideEffect = false;
setTimeout(() => {
this.showWalletsSelector = false;
}, 150);
}
示例8: saveForm
async saveForm(){
console.log('SAVE GOT CALLED')
await this.recipes.save(this.recipe.value)
this.events.publish('refresh-recipes')
this.nav.pop()
}
示例9: logEvent
logEvent(event) {
if ( this.description && this.value ) {
let saved = this.events.publish('saveItem', this.description, this.value );
if (saved) {
var toast = this.toastCtrl.create({
message: 'Datos guardados',
duration: 3000
});
this.description = "";
this.value = "";
} else {
var toast = this.toastCtrl.create({
message: 'Ocurrio un problema al guardar',
duration: 3000
});
}
toast.present();
} else {
let alert = this.alertCtrl.create({
subTitle: 'La descripciรณn y el valor son obligatorios',
buttons: ['OK']
});
alert.present();
}
}
示例10: onRemoveClick
public onRemoveClick() {
const index = this.listsService.lists.indexOf(this.list);
this.listsService.lists.splice(index, 1);
this.events.publish('lists:added');
this.listsService.sync();
this.viewController.dismiss(true);
}