Answer the question
In order to leave comments, you need to log in
How to infer object property from [object Object]?
Hello! Why does it output [object Object] when trying to parse an object?
I threw an object from ngFor into the data attribute. I get it through the dataset, I try to access the properties by clicking the Check button , but in the console it gives out undefined
For clarity, I threw in an example: stackblitz
Answer the question
In order to leave comments, you need to log in
You can only put a string in the data attribute.
If you want to write or read an object there, you need to serialize it, and after reading it, deserialize it.
Many objects will "break" in this case.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question