Here I get below dynamic data
[
{
id: 151,
name: 'Alan B. Shepard, Jr.',
job: 'Astronaut',
year_joined: 1959,
missions: ['MR-3', 'Apollo 14']
},
{
id: 152,
name: 'Virgil I. Grissom',
job: 'Astronaut',
year_joined: 1959,
missions: ['MR-4', 'Apollo 1']
},
{
id: 153,
name: 'John H. Glenn, Jr.',
job: 'Astronaut',
year_joined: 1959,
missions: ['MA-6','STS-95']
},
{
id: 154,
name: 'M. Scott Carpenter',
job: 'Astronaut',
year_joined: 1959,
missions: ['MA-7']
}
];
And here I can display this dynamic data in a table using angular 2 *ngFor , but here the problem I came across is:
How to display drop-down lists in a dynamic table in my dynamic data, I want to display the “missions” field as a drop-down list so that the user can select a drop-down menu.
I am currently displaying the above dynamic table in divOne. How can I click it in divTwo? I mean another div that is empty here. I want to select a row or any row that I select, I want to send it to an empty div, how to perform these actions.
html-:
<table class="table" *ngFor=let data of Table>
<thead>
<tr>
<th>id</th>
<th>name</th>
<th>job</th>
<th>year_joined</th>
<th>missions</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{data.id}}</td>
<td>{{data.name}}</td>
<td>{{data.job}}</td>
<td>{{data.year_joined}}</td>
</tr>
</tbody>
</table>
, , "". , , , DIV