I'm facing an issue with a method that involves the use of setInterval
public retrieveMessages(route: string) {
this.http.get(this.url + route + "?page=" + MessageService.plus)
.subscribe(function(response) {
if (response.json.length === 0) {
MessageService.plus++;
this.updateMessageList(response);
return;
};
});
}
The main problem here is that any functions defined inside function must be static, otherwise they will be undefined. Although I declared 'plus' as static, I am unable to do so for 'updateMessageList'. Can anyone provide guidance on how to correct this without needing to declare my properties as static?
Appreciate your help!