本文整理汇总了TypeScript中ionic-angular.Events类的典型用法代码示例。如果您正苦于以下问题:TypeScript Events类的具体用法?TypeScript Events怎么用?TypeScript Events使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Events类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: listenToGpsEvents
listenToGpsEvents() {
this.events.subscribe('gps:on', () => {
this.gpstracking = true;
});
this.events.subscribe('gps:off', () => {
this.gpstracking = false;
});
}
开发者ID:maxamillion32,项目名称:fleetany-mobile,代码行数:9,代码来源:login.ts
示例2: listenToLoginEvents
listenToLoginEvents() {
//fired when the user logs in
this.events.subscribe('user:login', () => {
this.loadStations();
});
this.events.subscribe('user:logout', () => {
if (this.stations) {
this.stations = null;
}
});
}
开发者ID:RickyTaterSalad,项目名称:FireIonic2,代码行数:11,代码来源:station-data.ts
示例3: listenToLoginEvents
listenToLoginEvents() {
this.events.subscribe('user:login', (str) => {
this.rootPage = 'TabsPage';
this.initJpush();
});
this.events.subscribe('user:logout', (str) => {
this.nativeService.removeStorage('token');
this.loginModal = this.modalCtrl.create('LoginPage');
this.loginModal.present();
this.rootPage = 'TabsPage';
});
}
开发者ID:qwb0920,项目名称:LlgApp,代码行数:12,代码来源:app.component.ts
示例4:
this.auth.onAuthStateChanged((user: any) => {
if (user) {
this.events.publish('user:login');
} else {
events.publish('user:logout');
}
});
开发者ID:balynsky,项目名称:ionic2-neighbors,代码行数:7,代码来源:firebase.service.ts
示例5: 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);
}
开发者ID:bitpay,项目名称:copay,代码行数:25,代码来源:incoming-data.ts
示例6: subscribeToNameListChanges
private subscribeToNameListChanges() {
this.events.subscribe("admin:name:added", (data: Array<{uid: string, name: string, username: string}>) => {
let isSortingNeeded = false;
data.forEach((user) => {
if(user.uid !== this.firebaseService.getMyUid()) {
console.log("Adding:"+JSON.stringify(user));
this.nameList.push(user);
this.zone.run(() => this.nameClassifier.addToUserList(user));
isSortingNeeded = true;
}
});
if(isSortingNeeded) {
this.sortNameList();
}
});
this.events.subscribe("admin:name:changed", (data: Array<{uid: string, name: string, username: string}>) => {
let isSortingNeeded = false;
data.forEach((user) => {
let changedUser = this.nameList.find((iter)=> iter.uid === user.uid);
if(changedUser != null) {
changedUser.name = user.name;
changedUser.username = user.username;
console.log("updating user list");
this.zone.run(() => this.nameClassifier.updateUser(user));
isSortingNeeded = true;
}
});
if(isSortingNeeded) {
this.sortNameList();
}
});
}
开发者ID:isvicbhasme,项目名称:greeter,代码行数:33,代码来源:admin.ts
示例7: 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);
}
}
开发者ID:hcxiong,项目名称:copay,代码行数:31,代码来源:incoming-data.ts
示例8: openPINModal
private openPINModal(action): void {
this.isModalOpen = true;
this.events.publish('showPinModalEvent', action);
this.events.subscribe('finishPinModalEvent', () => {
this.isModalOpen = false;
this.events.unsubscribe('finishPinModalEvent');
});
}
开发者ID:bitjson,项目名称:copay,代码行数:8,代码来源:app.component.ts
示例9: openFingerprintModal
private openFingerprintModal(): void {
this.isModalOpen = true;
let isCopay = this.appProvider.info.nameCase == 'Copay' ? true : false;
this.events.publish('showFingerprintModalEvent', isCopay);
this.events.subscribe('finishFingerprintModalEvent', () => {
this.isModalOpen = false;
this.events.unsubscribe('finishFingerprintModalEvent');
});
}
开发者ID:bitjson,项目名称:copay,代码行数:9,代码来源:app.component.ts
示例10:
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);
});
开发者ID:mdash-ursi2016,项目名称:ionic_code_typescript,代码行数:12,代码来源:blservice.ts
注:本文中的ionic-angular.Events类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论