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


TypeScript AngularFirestoreCollection.valueChanges方法代码示例

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


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

示例1: _ConnectToFirebase

  _ConnectToFirebase() {
    let districtCollectionRef: AngularFirestoreCollection<District> = this.mAngularFirestore.collection("districts", ref => {
      return ref.where('province_code', '==', this.mProvince.code);
    });

    this.mDistricts = districtCollectionRef.valueChanges();

  }
开发者ID:chakke,项目名称:bdp-firebase,代码行数:8,代码来源:province-detail.ts

示例2: ionViewWillEnter

 ionViewWillEnter() {
   // var id = this.afAuth.auth.currentUser;
   const userId = this.afAuth.auth.currentUser.uid;
   // if (auth == auth){
   this.itemsCollection = 	this.afs
   .collection(`items`, ref => ref
   .where('users.${userId}', '==', true))
   .doc(userId)
   .collection(`items`); //ref()
   // this.itemsCollection = this.afs.collection('items', ref => ref.where('itemid', '==', 'itemid'));
   this.items = this.itemsCollection.valueChanges();
   // this.afAuth.authState.subscribe((auth) => console.log(auth.uid, this.items));
   // }
 }
开发者ID:damianbatson,项目名称:ionic3-firestore,代码行数:14,代码来源:home.ts

示例3: Chart_client_totalHT

 Chart_client_totalHT(): Observable<any> {
   return this.itemsCollection.valueChanges().pipe(
     map((data) => {
       const res = [];
       data.forEach(elem => {
         elem = new Prestation(elem);
         res.push({name : elem.client, value : elem.totalHT()});
         // console.log(elem);
       });
       // console.log(res);
       return res;
     })
   )
 }
开发者ID:ChristopheGueroult,项目名称:crm-init-bordeaux,代码行数:14,代码来源:prestation.service.ts

示例4: constructor

 constructor(
   private afs: AngularFirestore
 ) {
   this.itemsCollection = afs.collection<Prestation>('prestations');
   this.collection = this.itemsCollection.valueChanges().pipe(
     map((data) => {
       const res: Prestation[] = [];
       data.forEach(elem => {
         // console.log(elem);
         elem = new Prestation(elem);
         res.push(elem);
         // console.log(elem);
       });
       return res;
     })
   );
   // this.collection = [
   //   new Prestation({
   //     id: 'a1',
   //     intitule: 'Dev Angular',
   //     client: 'coderbase',
   //     lieu: 'Paris',
   //     date_debut: '2018-11-20T23:00:00.000Z',
   //     date_fin: '2018-11-21T23:00:00.000Z',
   //     tjm_ht: 500,
   //     nb_jours: 2
   //   }),
   //   new Prestation({
   //     id: 'b1',
   //     intitule: 'Dev Angular',
   //     client: 'm2i',
   //     lieu: 'Paris',
   //     date_debut: '2018-11-20T23:00:00.000Z',
   //     date_fin: '2018-11-21T23:00:00.000Z',
   //     tjm_ht: 500,
   //     nb_jours: 2
   //   }),
   //   new Prestation({
   //     id: 'c1',
   //     intitule: 'Dev Angular',
   //     client: 'edugroupe',
   //     lieu: 'Paris',
   //     date_debut: '2018-11-20T23:00:00.000Z',
   //     date_fin: '2018-11-21T23:00:00.000Z',
   //     tjm_ht: 500,
   //     nb_jours: 2
   //   }),
   // ];
 }
开发者ID:ChristopheGueroult,项目名称:crm-init-bordeaux,代码行数:49,代码来源:prestation.service.ts

示例5: getReservation

 getReservation(id) {
   this.reservationsCollection = this.afs.collection(`Houses/${id}/reservation`);
   this.reservation = this.reservationsCollection.valueChanges();
   return this.reservation;
 }
开发者ID:ChachaLim,项目名称:CIHouse,代码行数:5,代码来源:store.service.ts

示例6: ngOnInit

 ngOnInit() {
   this.messages = this.msgRef.valueChanges();
   this.scrollToBottom();
 }
开发者ID:mandarini,项目名称:ngc-workshop,代码行数:4,代码来源:chat.component.ts


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