当前位置: 首页>>代码示例>>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;未经允许,请勿转载。