Hello! When I try to load data used http services, always need to do other action before my data load, never load automatically, for example my service is
listAll(): Observable<any> {
return this.http.get<Clients[]>(this.variables.getServiceEndpoint() + '/clients/all/', {})
.pipe(catchError(err => {
this.notAllowed(err);
return throwError(err);
}
)
);
In my OnInit have that code
this.service.listAll()
.subscribe(i => {
this.clients = i as Clients[];
});
and in my table use this information
<tbody>
<tr *ngFor="let clients of clients">
but never load alone, always need to click any bottom, for load
Can help me?
Thanks
that works!
Thank you so much !!
I am glad to see that you solved your issue.
Regards,
Keenthemes support
Hi,
I think I can direct you to the solution. Try to follow the article: https://www.digitalocean.com/community/tutorials/angular-change-detection-strategy.
You need use changeDetectionRef
and after the row this.clients = i as Clients[];
try to call this.cd.detectChanges();
. It should help you with your issue.
Regards,
Keenthemes support