本文整理匯總了TypeScript中@ionic-native/badge.Badge類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Badge類的具體用法?TypeScript Badge怎麽用?TypeScript Badge使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Badge類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: Promise
return new Promise(resolve => {
if (this.platform.is('cordova')) {
// Clear badge.
this.badge.clear();
this.util.setJPushBadge(0);
}
// We're using Angular Http provider to request the data,
// then on the response it'll map the JSON data to a parsed JS object.
// Next we process the data and resolve the promise with the new data.
this.http.get('./assets/mocks/appsservice/load.json')
.subscribe(data => {
// we've got back the raw data, now generate the core schedule data
// and save the data for later reference
// let items = Array.from(data);
this.getNewInformationCount();
resolve(data);
});
});
示例2:
data => {
if (data.success) {
this.events.publish('messageCount', 0);
this.badge.clear();
this.utilService.toast('全部標記為已讀成功');
}
});
示例3: loginOut
loginOut() {
this.events.publish('messageCount', 0);
this.storage.clear();
this.badge.clear().then().catch(error => console.log(error));
this.navCtrl.pop();
}
示例4:
this.messageService.GetMessageCount({ accesstoken: this.user.accesstoken }).subscribe(data => {
this.messageCount = data.data;
this.events.publish('messageCount', data.data);
this.badge.set(data.data).then().catch(error => console.log(error));
})