I initiated an interval in an Angular component, but the requests are still being made even when I navigate to a different route. How do I halt the interval?
//function that returns an observable
getAllPolls() {
return Observable.interval(2000).switchMap(() => this._http.get('https://xq4kftam4k.execute-api.us-east-1.amazonaws.com/test/polls2'))
.map((res: Response) => res.json())
}