I am working with an Angular Material Table and I have created an interface that serves as the dataSource for the table. However, I am facing a challenge because the data coming from the backend is unknown. Is there a way to dynamically add a new value to the interface or even create the interface dynamically?
For instance, transforming this:
export interface PeriodicElement {
name: string;
position: number;
weight: number;
symbol: string;
}
into this:
export interface PeriodicElement {
name: string;
position: number;
weight: number;
symbol: string;
index: number;
}
or starting with an empty interface like this:
export interface PeriodicElement {}
and end up with:
export interface PeriodicElement {
name: string;
position: number;
weight: number;
symbol: string;
index: number;
}