Will Web 3.0 Replace Web 2.0?
Become a member
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
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
ahmed elbarbary
991
1.6k
194.7k
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