I am pretty much new in Angular. I have a json file. I want to get the value of "ciena" based on the input provided by user. Say if user provides 'ciena' then I should get the json for ciena only. I can not use the position like below because I am not sure about the input provided by user.
import * as familyNames from '../../../assets/jsonFiles/deviceFamilyList.json';
---> this.families = familyNames['families'][0]; --this will not work in my case.
{
"families": [
{
"**ciena**" : [
{"name": "Waveserver Family"},
{"name": "6500 Family"},
{"name": "5400 Family"},
{"name": "Z-Series"},
{"name": "3000 Family"},
{"name": "5000 Family"},
{"name": "6500 PTS"},
{"name": "8180"},
{"name": "8700"},
{"name": "Pluggable Transceiver Family"}
]
},
{
"**huawei**": []
}
]
}
So to get the particular json value of ciena or huawei from the json file what can I do in .ts file? I am using Angular 8.
Thanks in advance for help! :)