TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ahmed elbarbary
NA
1.6k
278.3k
How to access object and values on json and display as table
Feb 11 2020 2:55 AM
problem
How to access object and values from json and display as table on angular 7 ?
I need to loop within object json below then get values from json and display all objects on columns
and rows as values
if other qualification array have application on fn attribute then
show exist
else
show not exist
html view will be as below
Features
18831983
946447
946451
Compliance
RS - Not Compliant
RV - 2015/863
RS- Not Compliant
RV- 2019/863
RS-Compliant
RV- 2020/863
OtherQualification
NotExist
NotExist
Exist
service.ts
how to call api having link retun json below
https://localhost/api/getallfeatures
component.ts
objJson : any ;
ngOnInit() {
// call service
}
component.html
How to execute ts to get view desired result as first post
json object as below :
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 1
},
"hits": {
"total": {
"value": 104
},
"max_score": 1.0,
"hits": [
{
"_index": "partsdb",
"_type": "_doc",
"_source": {
"PID": 18831983,
"CID": 1006091,
"Compliance": [
{
"RS": "Not Compliant",
"RV": "2015/863"
}
],
"OtherQualification": [
{
"FN": "Calculated Failure Rate(FIT)",
"FV": "33.19",
"R": 293650338
},
{
"FN": "Confidence Level(UCL)",
"FV": "60%",
"R": 293650338
},
{
"FN": "Fails Quantity",
"FV": "0",
"R": 293650338
}
]
}
},
{
"_index": "partsdb",
"_type": "_doc",
"_source": {
"PID": 946447,
"CID": 1006091,
"Compliance": [
{
"RS": "Not Compliant",
"RV": "2019/863"
}
],
"OtherQualification": [
{
"FN": "Calculated Failure Rate(FIT)",
"FV": "33.19",
"R": 293650962
},
{
"FN": "Confidence Level(UCL)",
"FV": "60%",
"R": 293650962
},
{
"FN": "Fails Quantity",
"FV": "0",
"R": 293650962
}
]
}
},
{
"_index": "partsdb",
"_type": "_doc",
"_source": {
"PID": 946451,
"CID": 1006091,
"Compliance": [
{
"RS": "Not Compliant",
"RV": "2020/863"
}
],
"OtherQualification": [
{
"FN": "Application",
"FV": "33.19",
"R": 293650259
},
{
"FN": "Confidence Level(UCL)",
"FV": "60%",
"R": 293650259
},
{
"FN": "Fails Quantity",
"FV": "0",
"R": 293650259
}
]
}
}
]
}
}
can you please help me
Reply
Answers (
1
)
Error TS2339: property ‘rows’ does not exist on type ‘htmlel
Advance Course Content we can cover in Typescript