Angularfire2 - Query table with a param
<p>I am trying to retrieve all the items that have a param with a certain key.</p>

<p>Here is the function that fills an array with the retrieved items:</p>

<pre><code>    this.subscription = this.activatedRoute.params.subscribe(
     (param: any) =&gt; {
    let postId = param['id'];
    console.log(postId);
      this.postsService.subscribePostReplies(postId)
             .do(console.log)
            .subscribe(posts =&gt; { this.posts = posts; this.cdr.detectChanges(); });
     });
</code></pre>

<p>Here is the method within the service:</p>

<pre><code> subscribePostReplies(postKey: string) {
    return this.af.database.list('posts', {
        query: {
            orderByChild: 'repliedTo',
            equalTo: postKey
        }
    });
 }
</code></pre>

<p>Problem is the page refreshes when the query happens and I also get alerted with:
     FIREBASE WARNING: Using an unspecified index. Consider adding ".indexOn": "repliedTo" at /posts to your security rules for better performance </p>