{"status":"success","responseMesg":"{\"totalDomains\":1,\"accepted\":0,\"rejected\":0,\"errors\":\"[{\\\"errorMessage\\\":\\\"Could not connect to XRP, max retry count exceeded\\\",\\\"domainEventId\\\":\\\"119\\\"}]\"}"}
Above the response of a service call. I used angular.fromJson to convert this to a JSON. I was able to access accepted, rejected, status, totalDomains, responseMesg properly. But I'm not able to access errorMessages. When I print errors, I see following
[{"errorMessage":"Could not connect to XRP, max retry count exceeded","domainEventId":"119"}]
Which looks like an array. But I'm not able to access individual objects in this array of objects like if arr
is the array then I want to access arr[0].errorMessage
, but not able to. It prints undefined
. When I do arr.length
, it printed 93. Is this just getting treated as string ? How to solve ?