I am trying to do something elementary. I have json file pageDefinition.json which is loaded into my component. This is how json looks like:
...
"testArray": [
{"id": 0, "name": "row1"},
{"id": 1, "name": "row2"},
{"id": 2, "name": "row3"}
],
...
When I print all array with {{pageDefinition?.testArray | json}}
it works. But I want to get only one item with index from array. If I try to get first element: {{pageDefinition?.testArray[0] | json}}
app crash with exception:
EXCEPTION: TypeError: Cannot read property '0' of null in [
{{pageDefinition?.testArray[0] | json}}
in ExampleFile@10:8]
Where did I make a mistake?