本文整理汇总了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));
})