I am currently working with an object that looks like this:
export class Section{
singleLabel:string;
pluralLabel:string;
index:number;
dataInterface:Interface;
}
My goal is to assign an interface to the dataInterface field, as I need to use the Section object in certain components/services to determine the type of Interface required for a specific method:
httpClient.get<section.dataInterface>(url);
Here is an example of an interface that could be assigned to the dataInterface field:
export interface Idata {
numeroPagina:number;
numeroElementiPerPagina:number;
numeroTotaleElementi:number;
}
I would like to achieve something along these lines:
section.dataInterface = Idata;
httpClient.get<section.dataInterface>(url);
Is there a way to store an Interface within an object field like this? Thank you.