i have some data bind in table and on click of any specific i want to show current clicked object more related data in to another component(child component)
for example the data I'm taking from this link: http://jsonplaceholder.typicode.com/users
HTML Code:
<table>
<thead>
<th>
Id
</th>
<th>
name
</th>
<th>
username
</th>
<th>
email
</th>
<th>
street
</th>
<th>
suite
</th>
<th>
zipcode
</th>
<th>
phone
</th>
<th>
website
</th>
</thead>
<tbody>
<tr *ngFor="let data of httpdata">
<td>{{data.id}}
</td>
<td>{{data.name}}
</td>
<td>{{data.username}}
</td>
<td>{{data.email}}
</td>
<td>{{data.address.street}}
</td>
<td>{{data.address.city}}
</td>
<td>{{data.address.suite}}
</td>
<td>{{data.address.zipcode}}
</td>
<td>{{data.phone}}
</td>
<td>{{data.website}}
</td>
<td>
<a routerLink="/conflict-details/conflict" (click)="onSelect(data)">Go to
</a>
</td>
</tr>
</tbody>
</table>
if you see there is one go to button i have in table when i click on any specific data it should show me complete info about current clicked but in my case i want to bind the data in another component when i click on go to for specific that all td data should be display in new component(child).
simple i want to track click event for selected data in child component . and the table is rendered in parent component.
attached is the data table I have.
User:{{selectedUser.id }}
Name: {{selectedUser.name}}
Email: {{selectedUser.email}}
Phone: {{selectedUser.phone}}
Website: {{selectedUser.website}}
– Amit Golhar Dec 10 '18 at 10:43