I'm getting a typescript compilation error when using angularfire2:
Property 'take' does not exist on type 'FirebaseObjectObservable'
I'm importing the take operator from rxjs so this question doesn't help: AngularFire2 typings: "Property 'take' does not exist on type 'FirebaseObjectObservable<any>'"
Imports:
import { Component } from '@angular/core';
import { FormControl } from '@angular/forms';
import { AngularFire, FirebaseListObservable, FirebaseObjectObservable } from 'angularfire2';
import { Subscription } from 'rxjs';
import 'rxjs/add/operator/debounceTime';
import 'rxjs/add/operator/throttleTime';
import 'rxjs/add/operator/take';
Code that causes error:
this.af.database.object(`/xyz`).take(1);
Compiles if I cast to 'any':
var test: any = this.af.database.object(`/xyz`);
test.take(1);
Versions:
"typescript": "^2.1.4"
"rxjs": "^5.0.3"
"angularfire2": "^2.0.0-beta.6-preview"
I also tested and using 'take' on an rxjs Observable works fine. Since FirebaseObjectObservable extends Observable it should also work fine. Any ideas why typescript is giving me an error here?