I have many api in backend and want creat front Angular but how api return only the result ["domain1","domain2"] and i need to transform this llist String[] to Domain[], with
export interface Domain{
name:string;
}
this.domainService.getAll().subscribe((data: String[])=>{
data.forEach((value: String, index: number, array: String[]) => {
let domain:Domain;
domain.name = value;
this.domains.push(domain);
}
) })
//The variable 'domain' is used before being assigned