using throttleTime function on subject angular2 error

Viewed 1299

I'm trying to use throttleTime operator on a subject. I have imported the operator. I'm getting this error: this.cropSubject.asObservable(...).throttleTime is not a function. I can't figure out what is going wrong. Is this a bug?

import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { throttleTime } from 'rxjs/operator/throttleTime';


export class EditItemComponent implements OnInit, AfterViewInit{


    cropSubject: Subject<string> = new Subject<string>();


    constructor(private taggingDataService: TaggingDataService, private _elementRef : ElementRef) {
    taggingDataService.selectedTags.subscribe((newTags) => {
        this.selectedTags = newTags;
    })
    this.cropSubject.asObservable().throttleTime(1000).subscribe((croppedImageSrc) => {
        this.updateImageData(croppedImageSrc);
    })
}
1 Answers
Related