我有2个组件叫:
1)list (used to display customer list)
2)detail (used to display customer details)
这两个组件是通用组件,所以我在另一个名为 customer 的组件中使用这些组件 . 它将显示如下图所示:
在 list
组件上单击特定客户名称(前客户一)时,我在 details
组件上显示客户值(例如名称和年龄)(i,e客户详细信息) . 此方案正常运行 .
But i want first list-item(i,e customer one) to be highlighted and its value(i,e name and age) to be displayed on the details component by default. 像这样:
1 回答
加载
ListComponent
后,您可以发出第一个值 .ts
html
这是工作副本 - https://stackblitz.com/edit/list-examples-mine-mgshnt