Answer the question
In order to leave comments, you need to log in
How to create one object from another with different names?
There is a field object
export interface Field {
// Название
name?:string;
// Заголовок
title?:string;
// Номер по порядку
position:number;
// Ориентация
orientation:Orientation;
// Флаг, указывающий что по полю надо посчитать сумму итога
totalSum:boolean;
}
this.colsFields = [
{field: 'id', header: 'УИД поля'},
];
Answer the question
In order to leave comments, you need to log in
Well, you need separate interfaces
interface BaseField {
title?: string;
name?: string;
}
interface Field extends BaseField {
position: number;
orientation: Orientation;
totalSum: boolean;
}
interface ColField {
field: BaseField;
header: string;
...
}
this.colsFields: ColField[] = [
...
];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question