Answer the question
In order to leave comments, you need to log in
How to get angulaR asynchronous variable?
There is a json file, I get its contents via fetch and display the length of this array, but when I get the length, I get the error "Cannot read properties of undefined" in the console, although the list of elements and the length are still displayed, how to get rid of the error?
Answer the question
In order to leave comments, you need to log in
Add a question if in the template, for example: {{users?.length}}
Or assign to your default array []: public users = []
That's why it's better not to disable it
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question