I'm trying to get two values from a JSON
Content of JSON:
[
{
"type":"session_start",
"properties":[
{
"property":"activity",
"type":"string"
}
]
}
]
to use in a component but been having trouble with getting the value of property
these are the codes I'm trying to use right now, but for some reason I get the error.
Property 'properties' does not exist on type 'Object'.
any ideas on how to make the outcome of props be "activity" ?
type = this.service.getData().pipe(map((response: any) => response.map((eventRead: { [x: string]: any; }) => eventRead['name'])));
props = this.service.getData().pipe(map(p => p?.properties?.property));

map((p: any) => p?.properties?.property)