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


TypeScript AngularFireDatabase.list方法代码示例

本文整理汇总了TypeScript中@angular/fire/database.AngularFireDatabase.list方法的典型用法代码示例。如果您正苦于以下问题:TypeScript AngularFireDatabase.list方法的具体用法?TypeScript AngularFireDatabase.list怎么用?TypeScript AngularFireDatabase.list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@angular/fire/database.AngularFireDatabase的用法示例。


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

示例1:

      db.object('PERRINNTeams/' + this.UI.currentTeam + '/chatReplayMode').valueChanges().subscribe(snapshot => {
        if (snapshot != undefined) {
          this.chatReplayMode = snapshot ? true : false;
        }
        this.previousMessageTimestamp = 0;
        this.previousMessageUser = '';
        this.draftMessageDB = false;
        this.draftImage = '';
        this.draftImageDownloadURL = '';
        this.draftMessage = '';
        this.messageNumberDisplay = 15;
        this.teamMessages = this.db.list('teamMessages/' + this.UI.currentTeam, ref => ref.limitToLast(this.messageNumberDisplay)).snapshotChanges().pipe(map(changes => {
          this.UI.loading = false;
          const updateObj = {};
          changes.forEach(c => {
            updateObj['teamReads/' + this.UI.currentUser + '/' + this.UI.currentTeam + '/' + c.payload.key] = true;
          });
          this.db.database.ref().update(updateObj);
          return changes.map(c => ({key: c.payload.key, values: c.payload.val()}));
        }));
        if (this.chatReplayMode) {
          this.chatReplayLoop();
        }
        this.draftMessageUsers = this.db.list('teamActivities/' + this.UI.currentTeam + '/draftMessages/').snapshotChanges().pipe(map(changes => {
          return changes.map(c => ({key: c.payload.key, values: c.payload.val()}));
        }));

        afs.doc<any>('PERRINNTeams/'+this.UI.currentUser+'/viewTeams/'+this.UI.currentTeam).valueChanges().subscribe(userTeam => {
          if (userTeam!=null&&userTeam.lastChatVisitTimestamp!=undefined) {this.lastChatVisitTimestamp = Number(userTeam.lastChatVisitTimestamp); }
          else this.lastChatVisitTimestamp=0;
        });
      });
开发者ID:PERRINN,项目名称:client-web,代码行数:32,代码来源:chat.component.ts

示例2:

 this.route.params.subscribe(params => {
   this.UI.currentTeam = params.id;
   this.teamLeaders = this.db.list('PERRINNTeams/' + this.UI.currentTeam + '/leaders').snapshotChanges().pipe(map(changes => {
     return changes.map(c => ({
       key: c.payload.key,
       values: c.payload.val(),
       name: this.db.object('PERRINNTeams/' + c.payload.key + '/name').valueChanges(),
       imageUrlThumb: this.db.object('PERRINNTeams/' + c.payload.key + '/imageUrlThumb').valueChanges(),
     }));
   }));
   this.teamMembers = this.db.list('PERRINNTeams/' + this.UI.currentTeam + '/members').snapshotChanges().pipe(map(changes => {
     return changes.map(c => ({
       key: c.payload.key,
       values: c.payload.val(),
       name: this.db.object('PERRINNTeams/' + c.payload.key + '/name').valueChanges(),
       imageUrlThumb: this.db.object('PERRINNTeams/' + c.payload.key + '/imageUrlThumb').valueChanges(),
     }));
   }));
   this.db.object('PERRINNTeams/' + this.UI.currentTeam + '/parent').snapshotChanges().subscribe(changes => {
     this.parent = changes.payload.val().toString();
     this.parentName = this.db.object('PERRINNTeams/' + this.parent + '/name').valueChanges();
     this.parentImageUrlThumb = this.db.object('PERRINNTeams/' + this.parent + '/imageUrlThumb').valueChanges();
   });
   this.teamChildren = this.db.list('PERRINNTeams/' + this.UI.currentTeam + '/children').snapshotChanges().pipe(map(changes => {
     return changes.map(c => ({
       key: c.payload.key,
       values: c.payload.val(),
       name: this.db.object('PERRINNTeams/' + c.payload.key + '/name').valueChanges(),
       imageUrlThumb: this.db.object('PERRINNTeams/' + c.payload.key + '/imageUrlThumb').valueChanges(),
     }));
   }));
 });
开发者ID:PERRINN,项目名称:client-web,代码行数:32,代码来源:teamProfile.component.ts

示例3:

 this.afAuth.user.subscribe((auth) => {
   this.db.list('users/' + auth.uid).push({
     timestamp: firebase.database.ServerValue.TIMESTAMP,
     name,
     familyName,
   });
 });
开发者ID:PERRINN,项目名称:client-web,代码行数:7,代码来源:login.component.ts

示例4: deleteAsobeData

  public deleteAsobeData(asobeData: IAsobeData): Promise<void> {
    // NOTE(baba): remove() は誤って全データを削除できてしまうので、念のため二重でチェック
    if (typeof asobeData.id === 'undefined') {
      throw new Error(`You should not throw 'asobeData.$key' with undefined to remove() API!`);
    }

    // NOTE(baba): remove()の引数を空にしたり、undefinedやnullを渡すとDBが丸ごと消えるのでテストしないこと!
    return this.afDb.list('/asobe').remove(asobeData.id);
  }
开发者ID:kyoyababa,项目名称:okuru.tsunashima,代码行数:9,代码来源:asobe.service.ts

示例5: constructor

  constructor(
    public modalCtrl: ModalController,
    public afs: AngularFirestore, 
		public fireAuth: AngularFireAuth,
		public db: AngularFireDatabase, 
		public navCtrl: NavController, 
		public navParams: NavParams) {
  	this.addressesRef = db.list('users/'+fireAuth.auth.currentUser.uid+'/addresses/', ref => ref.orderByChild('name'))
  	this.addresses = this.addressesRef.valueChanges();
  }
开发者ID:nmrisrl11,项目名称:Ecrotion_Buyer,代码行数:10,代码来源:buyer-addresses.ts

示例6: constructor

  constructor(
  	private viewCtrl: ViewController,
  	private modalCtrl: ModalController,
  	public zone: NgZone, 
  	private fireAuth: AngularFireAuth, 
  	private db: AngularFireDatabase, 
  	public navCtrl: NavController, 
  	public navParams: NavParams) {

  	this.addressesRef = db.list('users/'+fireAuth.auth.currentUser.uid+'/addresses/', ref => ref.orderByChild('name'))
  	this.addresses = this.addressesRef.valueChanges();
  }
开发者ID:nmrisrl11,项目名称:Ecrotion_Buyer,代码行数:12,代码来源:buyer-choose-address.ts

示例7: constructor

 constructor(public db: AngularFireDatabase, public router: Router, private _zone: NgZone, public UI: userInterfaceService) {
   this.enteringAmount = true;
   this.enteringCardDetails = false;
   this.processingPayment = false;
   this.newPaymentID = '';
   this.messagePayment = '';
   this.messagePERRINNTransaction = '';
   this.amountCOINSPurchased = 100;
   this.currentCurrencyID = 'gbp';
   this.currencyList = db.list('appSettings/currencyList').snapshotChanges().pipe(map(changes => {
     return changes.map(c => ({key: c.payload.key, values: c.payload.val()}));
   }));
   this.refreshAmountCharge();
 }
开发者ID:PERRINN,项目名称:client-web,代码行数:14,代码来源:buyCoins.component.ts

示例8: constructor

 constructor(
     public navCtrl: NavController,
     public navParams: NavParams,
     public afAuth: AngularFireAuth,
     public db: AngularFireDatabase,
     public alertCtrl: AlertController) {
         
     this.poemsRef = db.list('poems');
     // Use snapshotChanges().map() to store the key
     this.poems = this.poemsRef.snapshotChanges().pipe(
       map(changes => 
         changes['map'](c => ({ key: c.payload.key, ...c.payload.val() }))
       )
     );
 }
开发者ID:lazaryo,项目名称:poetry-manager,代码行数:15,代码来源:poems.ts

示例9: scrollHandler

 scrollHandler(e: string) {
   if (e === 'top') {
     this.UI.loading = true;
     this.messageNumberDisplay += 15;
     return this.teamMessages = this.db.list('teamMessages/' + this.UI.currentTeam, ref => ref.limitToLast(this.messageNumberDisplay)).snapshotChanges().pipe(map(changes => {
       this.UI.loading = false;
       const updateObj = {};
       changes.forEach(c => {
         updateObj['teamReads/' + this.UI.currentUser + '/' + this.UI.currentTeam + '/' + c.payload.key] = true;
       });
       this.db.database.ref().update(updateObj);
       return changes.map(c => ({key: c.payload.key, values: c.payload.val()}));
     }));
   }
 }
开发者ID:PERRINN,项目名称:client-web,代码行数:15,代码来源:chat.component.ts

示例10: refreshSearchLists

 refreshSearchLists() {
   if (this.searchFilter) {
     if (this.searchFilter.length > 1) {
       this.teams = this.db.list('PERRINNSearch/teams', ref => ref
       .orderByChild('nameLowerCase')
       .startAt(this.searchFilter.toLowerCase())
       .endAt(this.searchFilter.toLowerCase() + '\uf8ff')
       .limitToFirst(10))
       .snapshotChanges().pipe(map(changes => {
         return changes.map(c => ({
           key: c.payload.key,
           values: c.payload.val(),
         }));
       }));
     }
   } else {
     this.teams = null;
   }
 }
开发者ID:PERRINN,项目名称:client-web,代码行数:19,代码来源:search.component.ts


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