I have a matBadge who is in a *ngFor and it gets filled wit data who gets calculated with a method who goes into my backend and it needs the parameter chat.id for thids method but it gets inifinte called:
HTML:
{{ chat.chatName }}
TS:
countMessages(chatID: number): Observable {
return this.messageService.notReadMessagesChat(chatID, this.userId).pipe(
take(1),
);
}
it should give out 1 1 1 3 and that works but it makes it infinite and that make my application crash