當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript firestore.AngularFirestoreDocument類代碼示例

本文整理匯總了TypeScript中@angular/fire/firestore.AngularFirestoreDocument的典型用法代碼示例。如果您正苦於以下問題:TypeScript AngularFirestoreDocument類的具體用法?TypeScript AngularFirestoreDocument怎麽用?TypeScript AngularFirestoreDocument使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了AngularFirestoreDocument類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: updateUserData

    private updateUserData(user, enteredName?: string) {
        const userRef: AngularFirestoreDocument<any> = this.afs.doc(`users/${user.uid}`);

        const data: User = {
            uid: user.uid,
            email: user.email,
            displayName: user.displayName || enteredName,
            photoURL: user.photoURL || null,
        };

        return userRef.set(data, { merge: true });
    }
開發者ID:jacobbowdoin,項目名稱:RapidWords,代碼行數:12,代碼來源:auth.service.ts

示例2: updateUserData

  // Sets user data to firestore after succesful login
  private updateUserData(user: User) {
    const userRef: AngularFirestoreDocument<User> = this.afs.doc(
      `users/${user.uid}`
    );

    const data: User = {
      uid: user.uid,
      email: user.email || null,
      displayName: user.displayName || 'Anon',
      photoURL: user.photoURL || 'https://api.adorable.io/avatars/100/andrews.codes.png'
    };
    return userRef.set(data);
  }
開發者ID:geeksmarter,項目名稱:andrews.codes,代碼行數:14,代碼來源:auth.service.ts

示例3: SetUserData

 SetUserData(user) {
   const userRef: AngularFirestoreDocument<any> = this.afs.doc(`users/${user.uid}`);
   const userData: User = {
     uid: user.uid,
     email: user.email,
     displayName: user.displayName,
     photoURL: user.photoURL,
     emailVerified: user.emailVerified
   };
   return userRef.set(userData, {
     merge: true
   });
 }
開發者ID:niawjunior,項目名稱:blog,代碼行數:13,代碼來源:auth.service.ts

示例4: updateUserData

  private updateUserData({ uid, email, displayName, photoURL }: User) {
    const userRef: AngularFirestoreDocument<User> = this.afs.doc<User>(
      `users/${uid}`
    );

    const data = {
      uid,
      email,
      displayName,
      photoURL
    };

    return userRef.set(data, { merge: true });
  }
開發者ID:ajheunis,項目名稱:firebase-test-1,代碼行數:14,代碼來源:auth.service.ts

示例5: uploadContentDetail

  async uploadContentDetail(title, tag, slugUrl, imageUrl, description) {
    const contentData = {
      title,
      tag,
      slugUrl,
      imageUrl,
      description,
      timeStamp: Date.now(),
      view: 0
    };

    const contentRef: AngularFirestoreDocument<any> = this.afs.doc(`postDetail/${slugUrl}`);
    return contentRef.set(contentData, {
      merge: true
    });
  }
開發者ID:niawjunior,項目名稱:blog,代碼行數:16,代碼來源:upload-content.service.ts

示例6: updateUser

 private updateUser(data: any): Promise<void> {
   const userRef: AngularFirestoreDocument<any> = this.afs.doc(`users/${data.id}`);
   return userRef.set(data, { merge: true });
 }
開發者ID:Meistercoach83,項目名稱:sfw,代碼行數:4,代碼來源:auth.service.ts

示例7: deletejogador

 deletejogador(id, jogoId) {
     this.jogadorDoc = this.db.doc<Jogador>(`${config.jogoDB}/${jogoId}/${config.jogadorDB}/${id}`);
     this.jogadorDoc.delete();
 }
開發者ID:HermanoLeite,項目名稱:fodinha,代碼行數:4,代碼來源:jogador.service.ts

示例8: updatejogador

 updatejogador(id, update, jogoId) {
     this.jogadorDoc = this.db.doc<Jogador>(`${config.jogoDB}/${jogoId}/${config.jogadorDB}/${id}`);
     this.jogadorDoc.update(update);
 }
開發者ID:HermanoLeite,項目名稱:fodinha,代碼行數:4,代碼來源:jogador.service.ts

示例9: deleteJogo

 deleteJogo(id) {
     this.jogosDoc = this.db.doc<Jogo>(`${config.jogoDB}/${id}`);
     this.jogosDoc.delete();
 }
開發者ID:HermanoLeite,項目名稱:fodinha,代碼行數:4,代碼來源:jogo.service.ts

示例10: updateJogo

 updateJogo(id, update) {
     this.jogosDoc = this.db.doc<Jogo>(`${config.jogoDB}/${id}`);
     this.jogosDoc.update(update);
 }
開發者ID:HermanoLeite,項目名稱:fodinha,代碼行數:4,代碼來源:jogo.service.ts


注:本文中的@angular/fire/firestore.AngularFirestoreDocument類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。