title: How to access field of a document in firestore collection in angular?
body: <p>I'm trying to access photoUrl of user on the basis of ID, but unfortunalty am not getting hat is deserved.</p>
  <p>I have attached a picture of my firestore collection, Please tell me how I can access photoUrl.
  <a href="https://i.stack.imgur.com/p2Zvm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p2Zvm.jpg" alt="User is the main collection, document on the basis of ID are document and each document have some fielld I want to access photourl on the basis of ID." /></a>
  User is the main collection, document on the basis of ID are document and each document have some fielld I want to access photourl on the basis of ID.</p>
  <p><code>getImage(id) { this.users=this.db.collection('user').doc(id).collection('photurl').valueChanges(); console.log(this.users); }</code></p>
  <p>I have implemented the code in the answered but facing a new issue, the function continuously calls itself as the resulting picture is not displaying.</p>
  <p><code>&lt;div *ngFor=&quot;let Question of Questions &quot;&gt; &lt;img src=&quot;{{ getImage(Question.authorNo) }}&quot;  class=&quot;d-block ui-w-40 rounded-circle&quot; alt=&quot;&quot;&gt; </code></p>
  <p>This is my html, I have used iterator because I have many question, I am getting authorID of author and match it with the userID, if any userID matches AuthorID get it photoUrl and display it
  My function getting photoUrl is as follow</p>
  <p><code>getImage(id) { this.db.doc(</code>user/${id}`).valueChanges().subscribe(user =&gt; {
  this.user = user;
  this.url = this.user.photoUrl;
  //console.log(this.url);</p>
  <p>});
  return this.url;
  }`</p>