У меня проблемы с функцией lodash value () в angular7.
Мой код
export interface TariffList {
AccToNastrId: number,
TariffName: string,
List: MeterTariffsVm[]
}
...
meterTariffs: TariffList[];
...
this.pobutService.getMeterTariffs(this.cabinetId).subscribe(
(data: MeterTariffsVm[]) => {
this.isLoading = false;
this.meterTariffs = _(data).groupBy('AccToNastrId')
.map((objs: MeterTariffsVm[], accToNastrId: number) => ({
AccToNastrId: accToNastrId,
TariffName: _.find(objs, ['AccToNastrId', +accToNastrId]).TariffName,
List: objs
})).value();
},
error => {
this.notificationService.errorAlert(error);
this.isLoading = false;
});
У меня здесь ошибка:
this.meterTariffs = _(data).groupBy('AccToNastrId')
.map((objs: MeterTariffsVm[], accToNastrId: number) => ({
AccToNastrId: accToNastrId,
TariffName: _.find(objs, ['AccToNastrId', +accToNastrId]).TariffName,
List: objs
})).value();
У меня следующая ошибка:
(TS) Тип 'boolean []' нельзя назначить типу 'TariffList []'.
Есть идеи?