当前位置: 首页>>代码示例>>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;未经允许,请勿转载。