當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript FirebaseObjectObservable.set方法代碼示例

本文整理匯總了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
        });
	} 
開發者ID:ericel,項目名稱:goaf,代碼行數:58,代碼來源:places.service.ts

示例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;
 }
開發者ID:sridharmane,項目名稱:CleanSweepSite,代碼行數:9,代碼來源:data.service.ts

示例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"]);
 }
開發者ID:pacomar,項目名稱:rolgame,代碼行數:10,代碼來源:create.component.ts

示例4: createProfile

 createProfile(myProfile: IProfile): Promise<any> {
   return this.profileItem$.set(myProfile);
 }
開發者ID:mukesh51,項目名稱:vena,代碼行數:3,代碼來源:profile-service.ts

示例5: save

 save(newName: string) {
   this.item.set({ name: newName });
 }
開發者ID:DevKhater,項目名稱:Angular2SandBox,代碼行數:3,代碼來源:app.component.ts

示例6: saveObject

 saveObject(newName: string) {
   this.itemObject.set({ name: newName });
 }
開發者ID:Gmannheim,項目名稱:Angular2-Firebase,代碼行數:3,代碼來源:firebase-view.component.ts

示例7: save

 save(newName: string) {
     this.company.set({ name: newName });
 }
開發者ID:JacekKosciesza,項目名稱:InvestSystemsOrg,代碼行數:3,代碼來源:company-detail.component.ts

示例8: add

  add(value: string){
    this.item.set({name: value}); 

  }
開發者ID:BismaTahir,項目名稱:learn-angular2,代碼行數:4,代碼來源:app.component.ts

示例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);
 }
開發者ID:JacobDeming,項目名稱:HotfixEngine,代碼行數:82,代碼來源:environment.component.ts

示例10: save

 save() {
   alert(JSON.stringify(this.u));
   this.user.set( this.u );
 }
開發者ID:mierze,項目名稱:grouple-ng2,代碼行數:4,代碼來源:user-edit.ts


注:本文中的angularfire2.FirebaseObjectObservable.set方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。