I've got this JSON array (mdataarray)
[
{
"frumain" : "ESC",
"fruother" : "PAC or SEP or SPCB",
"connector" : "SE3 or SE7",
"sensor" : "ECHC, ECPC, ECCC, PCEC",
"motorsolenoid" : "ESCM",
"causeoferror" : "004, 101, 102, 103, 104, 106, 107, 108, 110, 111, 210, 211, 212, 213, 301, 302, 303, 304, 305, 306, 307, 312"
}
]
And I need to get just "causeoferror" object and slice it where the commas but I don't get it. I defined a new variable
public mdatacoe : string;
But when I do
this.mdatacoe = this.mdataarray.causeoferror;
In the console log I recieve undefined.
I'm pretty new to Typescript, I don't understand what I fail.
causeoferror. You should know it's an array, as you included that in the name.this.mdataarray[0].causeoferrorsince the object is contained within an array.