本文整理汇总了TypeScript中angularfire2.FirebaseObjectObservable.update方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FirebaseObjectObservable.update方法的具体用法?TypeScript FirebaseObjectObservable.update怎么用?TypeScript FirebaseObjectObservable.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angularfire2.FirebaseObjectObservable
的用法示例。
在下文中一共展示了FirebaseObjectObservable.update方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: editClass
editClass(classTObservable: FirebaseObjectObservable<IClassT>, classT: ClassT) {
return classTObservable.update({
name: classT.name,
professor: classT.professor,
timeSchedule: (classT.timeSchedule === undefined ? new HourDate() : classT.timeSchedule),
});
}
示例2: update
update( wordRef: FirebaseObjectObservable<any>, child:string, key:string, value:Object ) {
wordRef.update(
{[child]: {key: value}}
)
.then(_ => console.log("Update Size: OK"))
.catch( e => console.log("Update Size: Fail"));
}
示例3: saveMovie
saveMovie(movie: IMovie) {
console.log(movie.movieId);
// Have to always get the current data first?
const item: FirebaseObjectObservable<IMovie> =
this.af.database.object('movies/' + movie.movieId);
return item.update({title: movie.title});
}
示例4:
this.timerSubscription = timer.subscribe(t=>{
if(t <= this.gameClock.duration){
this.gameClock.ticks = t;
this.firebaseServer.update({Timer:this.gameClock.duration-this.gameClock.ticks});
} else {
this.stopClock();
}
})
示例5: updateUser
updateUser(user) {
console.log("Propagating update back to fb",user);
let key = user.$key;
let value = user.$value;
delete user.$key;
delete user.$value;
this.updatableUser.update(user);
user.$key = key;
}
示例6: readyToPlay
readyToPlay(){
this.ready=true;
if(this.playersReady === 0){
this.host = true;
} else {
this.host = false;
}
this.firebaseServer.update({Ready:this.playersReady+1});
}
示例7: updateUser
/**
* Take a firebase user (with $key) and use angularfire to update
*/
updateUser(user) {
let key = user.$key;
let value = user.$value;
let exists = user.$exists
delete user.$key;
delete user.$value;
delete user.$exists;
this.updatableUser.update(user);
user.$key = key;
user.$exists = exists;
}
示例8: updateUser
updateUser(id:number,first_name:string,last_name:string,email:string)
{
this.selectedUser.update({
id:id,
first_name:first_name,
last_name:last_name,
email:email
});
this._router.navigate(['']);
}
示例9: playAgain
playAgain(){
this.ready=true;
if(this.playersInfo.player1.playerClass=="Highwayman"){
this.playersInfo.player1.currentHitpoints = 80;
}
if(this.playersInfo.player1.playerClass=="Elementalist"){
this.playersInfo.player1.currentHitpoints = 50;
}
if(this.playersInfo.player1.playerClass=="Paragon"){
this.playersInfo.player1.currentHitpoints = 100;
}
if(this.playersInfo.player2.playerClass=="Highwayman"){
this.playersInfo.player2.currentHitpoints = 80;
}
if(this.playersInfo.player2.playerClass=="Elementalist"){
this.playersInfo.player2.currentHitpoints = 50;
}
if(this.playersInfo.player2.playerClass=="Paragon"){
this.playersInfo.player2.currentHitpoints = 100;
}
this.firebaseServer.update({Players:this.playersInfo});
this.firebaseServer.update({Ready:this.playersReady+1});
}