In my app there is the following data in a .json config file:
"directions": {
"horizontal": [
"left",
"right"
],
"vertical": [
"down",
"up"
]
}
In the app logic, the user selects one of the 4 specific directions (left, right, up, down) from a picker and then the word "horizontal" or "vertical" needs to be displayed in a label based on which option the user chose. So far, I have this code:
{{ specificDirection == 'right' ? 'horizontal' : 'other' }}
which verifies that the label displays the correct info when the user selects right. However, I'm at a loss for how to search the directions object in the .json file to find the specific direction in order to get the higher level direction to display in the label. Is it possible to do this without restructuring the JSON object?