I have defined an inner class in my component to hold the view model and I need to convert the http response interface to this view model. I tried this way:
@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, TaskListItemViewModel
type is not found. I tried also defining both the inner class and the method as static but still didn't work.
What am I missing?