当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript FirebaseListObservable.update方法代码示例

本文整理汇总了TypeScript中angularfire2.FirebaseListObservable.update方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FirebaseListObservable.update方法的具体用法?TypeScript FirebaseListObservable.update怎么用?TypeScript FirebaseListObservable.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在angularfire2.FirebaseListObservable的用法示例。


在下文中一共展示了FirebaseListObservable.update方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: updateAp

 public updateAp(activityPlan: ActivityPlan): void {
     this._activityPlans.update(activityPlan['$key'], {
         activities: activityPlan.activities,
         totalEnergy: activityPlan.totalEnergy,
         totalDuration: activityPlan.totalDuration
     });
 }
开发者ID:marcelpetersen,项目名称:life-guide-hybrid,代码行数:7,代码来源:activity-plan.service.ts

示例2: updateUserPrayer

 updateUserPrayer(key: string, newPrayerDetails: string) {
     var date = new Date();
     this.userPrayers.update( key, { 
       name: newPrayerDetails,
       updatedOn: date.toUTCString()
     });
 }
开发者ID:joyceview,项目名称:IonicAF2,代码行数:7,代码来源:prayer-data.service.ts

示例3: updateEvent

 updateEvent(data) {
     let promise = this._events.update(data.$key, {attendees: data.attendees });
     
     return promise.then(
         (res) => { return "Registered" },
         (err) => console.log(err)
     )
 }
开发者ID:aroget,项目名称:ng2-landr,代码行数:8,代码来源:events.service.ts

示例4: addMword

  addMword( mWord:Mword, saveMword:any ) {
    this.words.update( mWord.word, mWord )
    .then(_ => {
      console.log("addMword: OK");
      let m = this.getWord(mWord.word);
      this.updateParts( m, mWord.word, saveMword.part, saveMword.pronun );
    })
    .catch( e => console.log("addMword: Fail"));
	}
开发者ID:edicon,项目名称:ng2Test,代码行数:9,代码来源:mdic-fire.service.ts

示例5: toggleStatus

 public toggleStatus(item: TodoItem) {
   this.todos.update(
     item.$key,
     {
       done: item.done,
       updatedAt: firebase.database.ServerValue.TIMESTAMP,
     }
   );
 }
开发者ID:tarlepp,项目名称:Angular2-Firebase-Material-Demo,代码行数:9,代码来源:todos.component.ts

示例6: finishedTodo

    finishedTodo(key: string, finished: boolean, isFinished: boolean){
       
        var snapshotFinished = this._af.database.object('hr/todos/'+ key,{ preserveSnapshot: true})

        snapshotFinished.subscribe(snapshot => {          
            isFinished = snapshot.val().finished;  
        });

        if (isFinished == false || isFinished == null){
            this.todos.update(key,{finished: true});
            isFinished = true;
            console.log(isFinished);
        }    
        else{
            this.todos.update(key,{finished: false});
            isFinished = false;
            console.log(isFinished);
        }
    }
开发者ID:muscaiu,项目名称:HRbitech,代码行数:19,代码来源:todo.component.ts

示例7: update

 update(key: string, spice: Spice) {
     console.log(spice);
     
     var newSpice: Spice = JSON.parse(JSON.stringify(spice));
     delete newSpice.$key;
        
     this.spices.update(key, newSpice)
         .then(_ => console.log(key + ' update successful'))
         .catch(err => console.log(err, key + ' update error: ' + err));
 }
开发者ID:mkavcar,项目名称:AllSpiceNg2_nr,代码行数:10,代码来源:spice.service.ts

示例8: Date

 return this.auth.uid$.first().map(uid => {
   if (existingRequest) {
     this.list$.update(existingRequest.$key, { requestedBy: [...existingRequest.requestedBy, uid] });
   } else {
     const request: Request = {
       data: form,
       type: type,
       requestedBy: [uid],
       createdAt: new Date().toISOString()
     };
     this.list$.push(request);
   }
 });
开发者ID:Toxicable,项目名称:PassPast,代码行数:13,代码来源:request.service.ts

示例9: onDrinkRecord

  onDrinkRecord(drankCellarRecord: CellarRecord) {

    drankCellarRecord.count  = drankCellarRecord.count -1;
    if (drankCellarRecord.count <= 0) {
      this.cellarRecords.remove(drankCellarRecord.$key);
    } else {
      this.cellarRecords.update(drankCellarRecord.$key, {count: drankCellarRecord.count});
    }

    let drankRecord = new DrankRecord(drankCellarRecord);
    this.drankRecords.push(drankRecord);

  }
开发者ID:amulrean,项目名称:beercellarfire,代码行数:13,代码来源:beer-list.component.ts

示例10: updateMealPlan

 public updateMealPlan(mp: MealPlan): void {
   this._mealPlans.update(mp['$key'], {
     date: mp.date,
     breakfast: mp.breakfast,
     brunch: mp.brunch,
     lunch: mp.lunch,
     snack: mp.snack,
     dinner: mp.dinner,
     numericIntake: mp.numericIntake,
     percentIntake: mp.percentIntake,
     remainingIntake: mp.remainingIntake,
     requiredIntake: mp.requiredIntake
   });
 }
开发者ID:marcelpetersen,项目名称:life-guide-hybrid,代码行数:14,代码来源:meal-plans.service.ts


注:本文中的angularfire2.FirebaseListObservable.update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。