當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。