I have a service that will make a call to my rest service every 2 minutes. On my service I have the following function
getNotifications(token: string) {
const body = 'xxxxxxxxx=' + token;
return this.http.post('/rest/ssss/ddddddd/notificationcount', body, this.options)
.map((res) => res.json());
}
On my component I call my service function to call the API.
this.notificationService.getNotifications(this.token).subscribe((data) => {
console.log(data);
});
I want to make this call every 2 minutes, what is the best way to do this?
repeatWhen
? – Mantissa