使用panelbar Angular时获取[Object Object]

使用panelbar Angular时获取[Object Object],angular,kendo-ui,Angular,Kendo Ui,我试图将本地数据绑定到剑道panelbar,但我得到的是[object object],而不是正确的数据 在我的组件中: import { Component } from '@angular/core'; import { PanelBarItemModel } from '@progress/kendo-angular-layout'; @Component({ selector: 'my-app', styles: [` :host /deep/ .k-content {

我试图将本地数据绑定到剑道panelbar,但我得到的是[object object],而不是正确的数据

在我的组件中:

import { Component } from '@angular/core';
import { PanelBarItemModel } from '@progress/kendo-angular-layout';

@Component({
  selector: 'my-app',
  styles: [`
    :host /deep/ .k-content {
        padding: 4px 8px;
     }
`  ],
  template: `
    <div class="panelbar-wrapper">
       <kendo-panelbar [items]="ad"></kendo-panelbar>
   </div>`
  })

  export class AppComponent {
    x : any = [{'adress' : '124 JD'}, {'housenum': 1254}]
    public ad: Array<PanelBarItemModel> = [
      <PanelBarItemModel> {title: 'Address info', content: this.x },
   ];
 }
从'@angular/core'导入{Component};
从“@progress/kendo angular layout”导入{PanelBarItemModel};
@组成部分({
选择器:“我的应用程序”,
风格:[`
:host/deep/.k-content{
填充:4px8px;
}
`  ],
模板:`
`
})
导出类AppComponent{
x:any=[{'address':'124 JD'},{'housenum':1254}]
公共广告:数组=[
{标题:“地址信息”,内容:this.x},
];
}
这是我运行它时所拥有的:

有人能帮我吗?

{title:'Address info',content:this.x},
content值应该是字符串,而不是对象数组 你可以这样写

public ad: Array<PanelBarItemModel> = [
      <PanelBarItemModel> {title: 'Address info', content: `Address- ${this.x[0].adress}, housenum - ${this.x[1].housenum}` },
   ];
公共广告:数组=[
{title:'Address info',content:'Address-${this.x[0].Address},housenum-${this.x[1].housenum}`},
];

谢谢您的回答!你能帮我在单词地址后换行吗?你需要类似的东西,谢谢你