我正在尝试使用ngFor指令迭代组件属性。我的顶级组件是
export class OverviewComponent {
public mips : Array<Object> = [
{id: '44', label: 'MIPS 44', description: 'Preoperative Beta Blocker'},
{id: '76', label: 'MIPS 76', description: 'Central Line : Sterility'},
{id: '404', label: 'MIPS 404', description: 'Smoking Abstinence'},
{id: '424', label: 'MIPS 424', description: 'Perioperative Temperature Management'},
{id: '430', label: 'MIPS 430', description: 'PONV Adult'},
{id: '463', label: 'MIPS 463', description: 'PONV Pediatrics'},
];
...
}
在我的顶级组件html中,我有
<pie-chart class="mips-details"
*ngFor="let mip of mips"
summary="true"
details={{mip}}>
</pie-chart>
我的pie组件有一个输入参数,比如
export class PieChartComponent implements OnInit{
@Input()
details : any;
我遇到的问题是如何设置细节输入。按照我设置的方式,当我查看this.details时,它会显示“object object”。
我做错了什么?
https://stackoverflow.com/questions/51529505
复制相似问题