I have an interface with name SelectItem created automatically by primeNG like below. And i want to create an instance and add my select item array. If the SelectItem is class instead of interface, the code will be work. But now, giving an error. Please don't advice that change the type of SelectItem from interface to "class". I can't change because it is component of primeNG. How can i achieve this?
selectitem.ts
export interface SelectItem {
label?: string;
value: any;
styleClass?: string;
icon?: string;
title?: string;
disabled?: boolean;
}
my method
addUnselectedItem(selectItemList: SelectItem[]) {
let selectItem = new SelectItem(); //this row giving error
selectItem.value = "";
selectItem.label = "Please Select";
selectItemList.push(selectItem);
}