I have a abc component (part of the page). It has an event mouseup.
@Component({
selector: \'abc-component\'
})
@View({
A bit old but this might help somebody, you can use Observable.fromEvent too:
ngOnInit() {
this.mouseUpSubscription = Observable.fromEvent(window, "mouseup")
.throttleTime(30) // throttle time in ms, optional
.subscribe(res => {
this.mouseUpHandler(res);
});
}
ngOnDestroy() {
this.mouseUpSubscription.unsubscribe();
}