'Angular: How to find particular object in the .html file?
How to find perticular object in the .html page?
data = {
"zipCode": "40000",
"county": "Srilanka",
"state": "Northen",
"specilityData": [
{
"specialty": "North",
"specialtyCount": 1,
"specialtyRepresentation": 9411
},
{
"specialty": "South",
"specialtyCount": 4,
"specialtyRepresentation": 3323
},
{
"specialty": "East",
"specialtyCount": 1,
"specialtyRepresentation": 0
},
............................
............................
]
}
The data displayed in the .html file and we needed that particular "specilityData" details. How is it possible to get that data in .html?
<span class="card-field-values"> {{data?.specilityData.find(({ specialty }) => specialty === "North")?.specialtyCount}} </span>
This code throw the error in .html file. Do you have any idea?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
