Я внедряю раскрывающийся список Kendo в приложении angular 7. Я пытаюсь привязать объект FundClass к раскрывающемуся списку. Я передал объект fundclass от родительского компонента дочернему компоненту и связал эти данные с раскрывающимся списком в дочернем компоненте. Данные связываются и могут видеть данные в раскрывающемся элементе управления, но когда я выбираю раскрывающийся элемент,
Я получаю ошибку ниже
data.map is not a function
at DropDownListComponent.push../node_modules/@progress/kendo-angular-dropdowns/dist/es/dropdownlist.component.js.DropDownListComponent.findDataItem (dropdownlist.component.js:949)
Структура json данных, которые я связываю
"[{"FundClassId":13714,"FundClass":"Class D"},{"FundClassId":13717,"FundClass":"Class B"},{"FundClassId":13713,"FundClass":"Class A"},{"FundClassId":13716,"FundClass":"Class B1"},{"FundClassId":13715,"FundClass":"Class C"}]"
Родительский компонент
Объект данных здесь содержит объект FundClass.
getManagerStrategyFunds() {
this.strategyService.getManagerStrategyFunds(this.ManagerStrategyId, this.ValueDate)
.subscribe((data: any) => {
this.ViewModel = data;
this.GridOptions.rowData = data.SummaryPerformance;
this.FundPerformance = data.SummaryPerformance;
},
err => {
this.Error = 'An error has occurred. Please contact BSG';
},
() => {
});
}
Родительский компонент html. Прохождение объекта ftr.FundClass
<div class="panel panel-default">
<div class="panel-heading product-heading">
<span style="font-size: 14px; font-weight: bold;">Performance Track Record and Statistics</span>
</div>
<div *ngIf ="ViewModel.FundPerformance">
<div class="panel-body" style="width:100%">
<div *ngFor="let ftr of ViewModel.FundPerformance">
<fund-statistics [fundStatistics]="ftr.FundStatistics" [fundTrackRecord]= "ftr.TrackRecord" [fundName]="ftr.FundName"
[benchMark1Name]="ftr.BenchmarkName1" [benchMark2Name]="ftr.BenchmarkName2" [fundclass]="ftr.FundClass" ></fund-statistics>
</div>
</div>
</div>
</div>
Дочерний компонент
@Input() fundclass: any;
flashClassChanged(e) {
}
Child compoenent html
<kendo-dropdownlist style="width:170px" [data]="fundclass" [filterable]="false"
[(ngModel)]="fundclass" textField="FundClass" (valueChange)="flashClassChanged($event)"
valueField="FundClassId"></kendo-dropdownlist>