我只是尝试在模板中显示属性的值。但目前什么都没有显示。
这就是组件:
export class ServerStatusComponent implements OnInit {
snovieCollection: SnovietatusDto = {};
constructor(private snovierStatus: snovieStatusService) {}
ngOnInit(): void {
this.sensorStatus
.getSensorStatuses()
.pipe(
map((data) => {
console.log(data.cameraSensors);
})
)
.subscribe((status) => {
});
}
}
<p>Camera sensoren</p>
<tr *ngFor="let camera of snovieStatusCollection.key|keyvalue">
test
<h3> {{camera | json}}</h3>
</tr>
所以我只想在模板中显示key的值。以及控制台.log返回以下内容:
0: {key: "T", latestTimestamp: "2021-03-12T10:09:00Z"}