title: Fetching value from subscribed Observable with dynamic variable
body: <p>I'm learning how Observables work through Angular and Google  Firestore.</p>
  
  <pre><code>this.allinvoicesCollection = this.afs.collection('clients').doc(this.clientId).collection('inbox').valueChanges();
      this.allinvoicesCollection.subscribe(val =&gt; {
        this.fileUrl = val[this.currentIndex].downloadURL;
      })
  </code></pre>
  
  <p>I'm fetching the fileUrl with the above code.</p>
  
  <p>I want to update the fileUrl whenever the variable "this.currentIndex" changes however the above code obviously doesn't achieve that. </p>
  
  <p>I understand that this only triggers when a doc is changed in the collection. How would I make it trigger when detecting change in "this.currentIndex"? I should mention that "this.currentIndex" is not an Observable just a simple number variable changed by the user.</p>