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


TypeScript angularfire2.FirebaseObjectObservable類代碼示例

本文整理匯總了TypeScript中angularfire2.FirebaseObjectObservable的典型用法代碼示例。如果您正苦於以下問題:TypeScript FirebaseObjectObservable類的具體用法?TypeScript FirebaseObjectObservable怎麽用?TypeScript FirebaseObjectObservable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了FirebaseObjectObservable類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: 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});
 }
開發者ID:DeborahK,項目名稱:MovieHunter-Firebase,代碼行數:7,代碼來源:movie.service.ts

示例2: get

 get(key) : Observable<T> {
     let observer : FirebaseObjectObservable<T> = this.af.database.object(this.endpoint + key);
     return observer.map(item => {
         
         item.$key = key; 
         return item
     });
 }
開發者ID:edicon,項目名稱:ames,代碼行數:8,代碼來源:firebase.service.ts

示例3: 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"));
 }
開發者ID:edicon,項目名稱:ng2Test,代碼行數:7,代碼來源:mdic-fire.service.ts

示例4: editClass

 editClass(classTObservable: FirebaseObjectObservable<IClassT>, classT: ClassT) {
   return classTObservable.update({
     name: classT.name,
     professor: classT.professor,
     timeSchedule: (classT.timeSchedule === undefined ? new HourDate() : classT.timeSchedule),
   });
 }
開發者ID:filipemendes1994,項目名稱:FUTAdmin,代碼行數:7,代碼來源:classes.service.ts

示例5: constructor

  constructor(public platform: Platform, public navCtrl: NavController, public user:User, public push: Push, public navParams: NavParams, storage: Storage, public af: AngularFire, public loadingCtrl:LoadingController) {



  	// CARICA TUTTE LE GARE NEL DATABASE
    let loader = this.loadingCtrl.create({
    content: "Attendere il caricamento delle gare..."
    });
    loader.present();
    this.gare = af.database.object('/gare', { preserveSnapshot: true  });
    this.gare.subscribe(snapshot => {
        storage.set('gareDB', snapshot.val());
        this.navCtrl.setRoot(Page1)
        
    });
    this.gare.subscribe(() => loader.dismissAll());

    if (this.platform.is('android')) {  
      this.push.register().then((t: PushToken) => {
         return this.push.saveToken(t);
      }).then((t: PushToken) => {
         this.notificheSnap = this.af.database.object('/utenti/'+this.user.id+'/notifiche/', { preserveSnapshot: true });
         this.notificheSnap.set({pushToken:t.token});
      });
    }

    
  }
開發者ID:gianmichelesiano,項目名稱:Bandigare,代碼行數:28,代碼來源:aggiorna.ts

示例6: exportCSV

 exportCSV() {
   var dataString = "heyjoheyjoheyjoheyjo";
   var data = [];
   var filename = "";
   this.poll.subscribe((snap: any) => {
     if (snap.options !== undefined) {
       filename = snap.name.split(' ').join('') + ".results";
       for (let obj of snap.options) {
         data.push([obj.value, obj.score]);
       }
       data.push(['Total', this.total]);
     }
   });
   var csvContent = "data:text/csv;charset=utf-8,";
   data.forEach(function(infoArray, index){
     dataString = infoArray.join(",");
     csvContent += index < data.length ? dataString+ "\n" : dataString;
   });
   var encodedUri = encodeURI(csvContent);
   var link = document.createElement("a");
   link.setAttribute("href", encodedUri);
   link.setAttribute("download", filename+".csv");
   document.body.appendChild(link); // Required for FF
   link.click(); // This will download the data file named "my_data.csv".
 }
開發者ID:raayanpillai,項目名稱:droppoll-beta,代碼行數:25,代碼來源:poll-result-view.component.ts

示例7: constructor

 constructor(af:AngularFire, renderer: Renderer){
   this.URL = window.location.href;
   this.onOff = af.database.object('/'+this.URL.split('/game/')[1]+'/Globals/OnOff',{preserveSnapshot:true});
   this.onOff.subscribe(snapshot =>{
     this.environmentSnapshot = snapshot.val();
   });
   this.environment = af.database.object('/'+this.URL.split('/game/')[1]+'/Globals/Environment');
   this.players = af.database.object('/'+this.URL.split('/game/')[1]+'/Players',{preserveSnapshot:true});
   this.players.subscribe(snapshot =>{
     this.playersSnapshot = snapshot.val();
   });
   /* Gets keyup */
   this.getKey = renderer.listenGlobal('document', 'keyup', (event) => {
     var key = event.keyCode;
     this.toggleBtn(key);
   });
 }
開發者ID:JacobDeming,項目名稱:HotfixEngine,代碼行數:17,代碼來源:environment.component.ts

示例8:

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

示例9:

	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

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


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