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
279k
How to add keys to content body variable when display data d
May 20 2020 7:13 PM
I work on angular 7 app I display data and column headers dynamically
I show content data without header by using content Body Variable
but problem I face is cannot catch data values or catch data cell values so that
I need to add key to content body
my ts code
this
._displayreport.GetReportDetailsPaging(
this
.searchData).subscribe((data: any[]) => {
this
.reportdetailslist = data;
this
.headerCols = Object.keys(data[0]);
data.forEach((item) =>{
let values = Object.keys(item).map((key)=> item[key])
this
.contentBody.push(values);
});
to get contentbody data I do
<tr *ngFor=
"let rep of contentBody"
>
<td *ngFor=
"let r1 of rep"
><span>{{r1}}</span></td>
<td
</tr>
Result Returned
ReportId onlineurl reportdate
1222 localhost:5000/ 12-12-2018
data current for content body displayed on browser console as :
0:["1222","localhost:5000/","12-12-2018"]
Expected Result i need to content body display as below
0:[{revisionid:"1222",onlineurl:"localhost:5000/",reportdate:"12-12-2018"}]
Reply
Answers (
1
)
How to convert URL cell text as small link when press on it
How to remove plain text URL from data content column name o