title: How to properly query a Firebase list in AngularFire2?
body: <p>I'm developing an Angular2 application with Firebase as a backend. On a subpage I want to display some tasks for a given week which is specified by a route parameter.</p>
  
  <p>I'm using a <code>BehaviorSubject</code> as a parameter to the AngularFire2 query the following way:</p>
  
  <pre><code>export class PrepareComponent implements OnInit {
  
      private routeSub: any;
      weekId = '';
  
      private weekSubject: BehaviorSubject&lt;any&gt; = new BehaviorSubject('weekId');
  
      taskTemplates$: FirebaseListObservable&lt;TaskTemplate[]&gt;;
  
      constructor(private route: ActivatedRoute,
                  private router: Router,
                  private angularFire: AngularFire) {
  
          // this.taskTemplates$ = angularFire.database.list("/taskTemplates");
  </code></pre>
  
  <p>Here is the Firebase query:</p>
  
  <pre><code>        this.taskTemplates$ = angularFire.database.list("/taskTemplates", {
              query: {
                  equalTo: this.weekSubject
              }
          });
      }
  
      ngOnInit() {
          this.routeSub = this.route.params.map(
              (params: Params) =&gt; this.weekId = params[ 'weekid' ]
          ).subscribe(
              weekId =&gt; this.weekSubject.next(weekId)
          );
      }
  
      ngOnDestroy() {
          this.routeSub.unsubscribe();
      }
  }
  </code></pre>
  
  <p>Unfortunately, the Firebase <code>taskTemplates$</code> observable is not returning any data for the given weekId.</p>
  
  <p>I assumed that once the <code>weekId</code> will be set by querying the route parameters, the list would get it as a query parameter and return the data which has: <code>{ weekId: actualWeekId, ...}</code>.</p>
  
  <p><strong>EDIT</strong> Added an example of data stored in Firebase:</p>
  
  <pre><code>  {
     "-Kc_E0U4UOl9PPtxpzCM" : {
     "description" : "asdfasdf",
     "weekId" : "99f2"
    },
    "-Kc_E3wv3fhpUt56sM4u" : {
      "description" : "another task",
      "weekId" : "99f2"
    }
  }
  </code></pre>
  
  <p>So what I want to do is to get all records for a given <code>weekId</code> </p>