In order to convert the http response interface to the view model in my component, I have created an inner class to hold the necessary data. Here is my attempt:
@Component({
selector: 'app-tasklist-items-grid',
templateUrl: './tasklist-items-grid.component.html',
styleUrls: ['./tasklist-items-grid.component.scss'],
providers: [TasklistItemsService, BsModalService]
})
export class TasklistItemsGridComponent implements OnInit {
// .....
TaskListItemViewModel = class {
id?: number;
tasklistId: number;
typeOfTask: number;
statusId: number;
created_at: Date;
updated_at: Date;
checked: Boolean;
rowVersion: number;
}
convertToViewModel = (item: TaskListItemViewModel) => item;
}
However, the 'TaskListItemViewModel' type is not being found. I have tried to define both the inner class and the method as static, but it still does not work.
What could I be missing here?