本文整理匯總了TypeScript中services/localstorage.LocalStorage.saveNumber方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript LocalStorage.saveNumber方法的具體用法?TypeScript LocalStorage.saveNumber怎麽用?TypeScript LocalStorage.saveNumber使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類services/localstorage.LocalStorage
的用法示例。
在下文中一共展示了LocalStorage.saveNumber方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: addACigarette
addACigarette(){
this.totalCigarettes++;
this.weekCount++;
this.todayCount++;
this.budgetCigarettes = parseFloat(Math.round((this.cigarettePrice * this.totalCigarettes)*100)/100);
this.cigarettesLeft = (this.nbPacks * 20) - this.totalCigarettes;
this.localstorage.saveNumber('total-cigarettes', this.totalCigarettes);
let weekCount = JSON.parse( this.localstorage.get('week-count'));
weekCount.nb = this.weekCount;
this.localstorage.saveJson('week-count', JSON.stringify(weekCount));
let dayCount = JSON.parse(this.localstorage.get('day-count'));
dayCount.nb = this.todayCount;
this.localstorage.saveJson('day-count', JSON.stringify(dayCount));
if (!this.beginDate) {
this.beginDate = moment().format('DD/MM/YYYY');
this.localstorage.saveDate('begin-date', this.beginDate);
return this.beginDate;
}
}
示例2: addAPack
addAPack(pack:Number) {
this.nbPacks = pack;
this.localstorage.saveNumber('nb-packs', pack);
}
示例3: setNbPacks
setNbPacks(nbPacks){
this.localstorage.saveNumber('nb-packs', nbPacks);
}
示例4: setPricePack
setPricePack(price){
this.localstorage.saveNumber('price', price);
}
示例5: setDayGoal
setDayGoal(dayGoal){
this.localstorage.saveNumber('day-goal', dayGoal);
}
示例6: setWeekGoal
setWeekGoal(weekGoal){
this.localstorage.saveNumber('week-goal', weekGoal);
}