I got this error on angular enter image description here
and this is my service :
and this is my function on the component.ts
the problem is on the consol ther is a lot of error : ERROR TypeError: ctx.list is undefined ConsltoppoComponent_Template consltoppo.component.html:
also whene the data is null the page is blocked, i have other service is working good.
on html i call the list like that : enter image description here
and the type of the list is any
i hope i explain the problem, to get help of this problem
CodePudding user response:
You have an asynchronous call, that sets the result to the field list
. As long as the call is pending list
will be undefined, which will lead to errors, since you try to read typ_pret
from list
. It means you try to read a property of undefined. Make your template safe, add an *ngIf="list"
to your input element.