Angular 角度5-双向数据绑定不工作

Angular 角度5-双向数据绑定不工作,angular,typescript,data-binding,Angular,Typescript,Data Binding,我不明白。。。我想在我的服务上做一个get请求,它为我扫描的条形码提供了特定的硬件-这已经可以工作了 我将正确的硬件作为对象返回,如下所示-> 但是如果我现在想显示这个对象,我只在前端得到[object object] component.html {{ terminal }} 组件。ts terminal: any[] = []; constructor(private terminalService: TerminalService) { } this.terminalService

我不明白。。。我想在我的服务上做一个get请求,它为我扫描的条形码提供了特定的硬件-这已经可以工作了

我将正确的硬件作为对象返回,如下所示->

但是如果我现在想显示这个对象,我只在前端得到
[object object]

component.html

{{ terminal }}
组件。ts

terminal: any[] = [];

constructor(private terminalService: TerminalService) { }

this.terminalService.getTerminalByBarcode(barcode).subscribe(terminal => {
   console.log(terminal.terminal);
   this.terminal = terminal.terminal;
});

我已经尝试了
终端:Object但这不会改变任何事情。希望有人能告诉我,我认为双向数据绑定哪里不对?

如果
terminal.terminal
是一个对象,那么
{{terminal}
的输出可以是
[object object]
,因为它调用
toString

要查看
终端的结构,可以使用
json
管道

{{ terminal | json }}

如果
terminal.terminal
是一个对象,则
{{terminal}}
的输出可以是
[object object]
,因为它调用该对象上的
toString

要查看
终端的结构,可以使用
json
管道

{{ terminal | json }}

这是因为在视图中,您试图输出实际的object.toString

您需要输出对象属性,如下所示:

{{ terminal.barcode }}
{{ terminal.dateArrival }} 

这是因为在视图中,您试图输出实际的object.toString

您需要输出对象属性,如下所示:

{{ terminal.barcode }}
{{ terminal.dateArrival }} 

非常感谢,
| json
就是这个窍门!如果可能的话,我会尽快接受你的答案的。我猜,json就是这个窍门!将尽快接受您的回答您希望在UI上显示的对象属性是什么?您希望在UI上显示的对象属性是什么??