本文整理汇总了TypeScript中angularfire2.FirebaseObjectObservable.set方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FirebaseObjectObservable.set方法的具体用法?TypeScript FirebaseObjectObservable.set怎么用?TypeScript FirebaseObjectObservable.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angularfire2.FirebaseObjectObservable
的用法示例。
在下文中一共展示了FirebaseObjectObservable.set方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: listPlaces
listPlaces(name, cat, add, lat, lng, placeID, uid, username ) {
let places = this.af.database.object(`/goaf-list-places/${placeID}`);
let thisgeo = {
latitude: lat ,
longitude: lng
};
let openTime = {
Monday: {
status: 'true',
openTime: '09:00',
closeTime: '17:00'
},
Tuesday: {
status: 'true',
openTime: '09:00',
closeTime: '17:00'
},
Wednesday: {
status: 'true',
openTime: '09:00',
closeTime: '17:00'
},
Thursday: {
status: 'true',
openTime: '09:00',
closeTime: '17:00'
},
Friday: {
status: 'true',
openTime: '09:00',
closeTime: '17:00'
},
Saturday: {
status: 'true',
openTime: '09:00',
closeTime: '17:00'
},
Sunday: {
status: 'true',
openTime: '09:00',
closeTime: '17:00'
}
}
return places.set({
placeID: placeID,
placeName: name,
placeCat: cat,
placeAdd: add,
authorID: uid,
author: username,
rating: 0.5,
website: "no_website",
pPhone: "no_phone",
openHours: openTime,
geometry: thisgeo,
listDate: firebase.database.ServerValue.TIMESTAMP
});
}
示例2: setUserDetails
setUserDetails(userData: UserData) {
this.user = this.af.database.object('/users/' + userData.uid);
this.user.set({
name: userData.name,
email: userData.email,
type: userData.type
});
return this.user;
}
示例3: save
save(name: string, race: string, nclass: string) {
let nRace = this.races.find(x => x.id === race);
let nClass = this.classes.find(x => x.id === nclass);
this.character.set({ name: name, race: race, class: nclass, level: 1, experience: 1, base_life: 100, actual_life: 100,
gold: 100, busy: new Date().getTime(), busy_place: "",
strength: parseInt(nRace.strength) + parseInt(nClass.strength),
intelligence: parseInt(nRace.intelligence) + parseInt(nClass.intelligence),
agility: parseInt(nRace.agility) + parseInt(nClass.agility) });
this.router.navigate(["/character"]);
}
示例4: createProfile
createProfile(myProfile: IProfile): Promise<any> {
return this.profileItem$.set(myProfile);
}
示例5: save
save(newName: string) {
this.item.set({ name: newName });
}
示例6: saveObject
saveObject(newName: string) {
this.itemObject.set({ name: newName });
}
示例7: save
save(newName: string) {
this.company.set({ name: newName });
}
示例8: add
add(value: string){
this.item.set({name: value});
}
示例9: changeEnvironment
changeEnvironment(x){
var aether = 1;
var material = 1;
var chaos = 1;
var order = 1;
switch(x){
case 'rain':
if(this.environmentSnapshot.rain==true){
this.onOff.update({rain:false});
break;
} else {
this.onOff.update({rain:true});
break;
}
case 'fog':
if(this.environmentSnapshot.fog==true){
this.onOff.update({fog:false})
break;
} else {
this.onOff.update({fog:true});
break;
}
case 'lightning':
if(this.environmentSnapshot.lightning==true){
this.onOff.update({lightning:false})
break;
} else {
this.onOff.update({lightning:true});
break;
}
case 'quake':
if(this.environmentSnapshot.quake==true){
this.onOff.update({quake:false})
break;
} else {
this.onOff.update({quake:true});
break;
}
case 'snow':
if(this.environmentSnapshot.snow==true){
this.onOff.update({snow:false})
break;
} else {
this.onOff.update({snow:true});
break;
}
case 'storm':
if(this.environmentSnapshot.storm==true){
this.onOff.update({storm:false})
break;
} else {
this.onOff.update({storm:true});
break;
}
}
if (this.environmentSnapshot.rain == true) {
chaos += 1;
material += 2;
}
if (this.environmentSnapshot.fog == true) {
aether += 2;
order += 1;
}
if (this.environmentSnapshot.lightning == true) {
aether += 1;
chaos += 2;
}
if (this.environmentSnapshot.quake == true) {
order += 2;
material += 1;
}
if (this.environmentSnapshot.snow == true) {
aether += 2;
material += 2;
}
if (this.environmentSnapshot.storm == true) {
order += 2;
chaos += 2;
}
this.environment.set({aether:aether,material:material,chaos:chaos,order:order});
this.changeChampionStats(aether,material,chaos,order);
}
示例10: save
save() {
alert(JSON.stringify(this.u));
this.user.set( this.u );
}