A
A
Aidar2021-09-27 19:12:00
Angular
Aidar, 2021-09-27 19:12:00

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

1 answer(s)
S
Stalker_RED, 2021-09-27
@Aderus

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 question

Ask a Question

731 491 924 answers to any question