当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript angularfire2.FirebaseListObservable类代码示例

本文整理汇总了TypeScript中angularfire2/angularfire2.FirebaseListObservable的典型用法代码示例。如果您正苦于以下问题:TypeScript FirebaseListObservable类的具体用法?TypeScript FirebaseListObservable怎么用?TypeScript FirebaseListObservable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了FirebaseListObservable类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: getNewTaskListID

 /**
  * Generates and returns a unique id for a task list.
  * @returns {string}
  */
 private getNewTaskListID(): string {
   let taskLists: FirebaseListObservable<any[]> =
       this.angularFire.database.list(TASK_LIST_METADATA_PATH);
   return taskLists.push(null).key;
 }
开发者ID:hanaum,项目名称:choose_to_go,代码行数:9,代码来源:taskList.service.ts

示例2: saveEvent

  saveEvent(event: EventModel): EventModel {
    if (!event) {
      return null;
    }

    if (event.$key) {
      this.events$.update(event.$key, _.omit(event, ['$key', '$exists']));
    } else {
      this.events$.push(event);
    }
    return event;
  }
开发者ID:vincent314,项目名称:jsrol-ng2,代码行数:12,代码来源:jsrol.service.ts

示例3: saveTrack

  saveTrack(track: TrackModel, kml?: string): TrackModel {
    // Should save a new KML or keep existing ?
    let kmlObject = {};
    if (kml) {
      console.debug('Saving a new KML', kml);
      kmlObject = {kml: this.saveKml(kml).key};
    }

    const newTrack: TrackModel = Object.assign(
      {},
      track,
      kmlObject);

    if (newTrack.$key) {
      console.debug('Update track');
      this.tracks$.update(newTrack.$key, _.omit(newTrack, ['$key', '$exists']));
    } else {
      console.debug('Create a new track');
      this.tracks$.push(newTrack);
    }
    return newTrack;

  }
开发者ID:vincent314,项目名称:jsrol-ng2,代码行数:23,代码来源:jsrol.service.ts

示例4: save

  save(name:string,
       length:string,
       key:string,
       tempo:string,
       artist:string,
       genre:string,
       lyrics:string,
       notes:string,
       other:string
  ){
    if(this.isNew === true){

      //this.artists.map( artists => artists.filter(artist => artist.name === artist.name));

      var newItemKey = this.songs.push({name:name,length:length,key:key, tempo:tempo,lyrics:lyrics, uid:this.uid}).key;


    }
    else
    {

      this.getOrCreateArtist(artist).then(
        function(result){
          var artistKey;
          if(result){
            artistKey = result['$key'];
          }
          else{
            artistKey = this.artists.set({name:artist}).key;
          }

          /*const user = this.af.database.object(`users/${login}`);
          user.subscribe(data => {
            if(data.$value !== null) {
              console.log('User does not exist');
            } else {
              console.log('User does exist');
            }
          });*/

          this.song.update({name:name,length:length,key:key, tempo:tempo, lyrics:lyrics, artistId:artistKey});
        }
      );

    }

    this.router.navigate(['/songs']);
  }
开发者ID:timburnham73,项目名称:slhweb,代码行数:48,代码来源:song-edit.component.ts

示例5: function

        function(result){
          var artistKey;
          if(result){
            artistKey = result['$key'];
          }
          else{
            artistKey = this.artists.set({name:artist}).key;
          }

          /*const user = this.af.database.object(`users/${login}`);
          user.subscribe(data => {
            if(data.$value !== null) {
              console.log('User does not exist');
            } else {
              console.log('User does exist');
            }
          });*/

          this.song.update({name:name,length:length,key:key, tempo:tempo, lyrics:lyrics, artistId:artistKey});
        }
开发者ID:timburnham73,项目名称:slhweb,代码行数:20,代码来源:song-edit.component.ts

示例6: deleteTrack

 deleteTrack(track: TrackModel): void {
   if (track.kml) {
     this.removeKml(track.kml);
   }
   this.tracks$.remove(track.$key);
 }
开发者ID:vincent314,项目名称:jsrol-ng2,代码行数:6,代码来源:jsrol.service.ts

示例7: removeKml

 removeKml(kml: string) {
   this.kmls$.remove(kml);
 }
开发者ID:vincent314,项目名称:jsrol-ng2,代码行数:3,代码来源:jsrol.service.ts

示例8: saveKml

 saveKml(kml: string): firebase.database.ThenableReference {
   return this.kmls$.push(kml);
 }
开发者ID:vincent314,项目名称:jsrol-ng2,代码行数:3,代码来源:jsrol.service.ts

示例9: deleteEvent

 deleteEvent(key: string) {
   this.events$.remove(key);
 }
开发者ID:vincent314,项目名称:jsrol-ng2,代码行数:3,代码来源:jsrol.service.ts


注:本文中的angularfire2/angularfire2.FirebaseListObservable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。