I have an Interface
export interface IEmployee{
id: string;
first_name: string;
}
In my employee.service.ts
getEmployess():Observable<IEmployee>{
return this._http.get<IEmployee>(this._dataUrl);
}
In my component
employees:Array<IEmployee>;
constructor(private _employeeService:EmployeeService){
this._employeeService.getEmployess()
.subscribe(
(data) => {
this.employees = data;
console.log(data);
}
)
}
I am gettign the erro [ts] Type 'IEmployee' is not assignable to type 'IEmployee[][]'.
I am unable to understand whats wrong. I want that the returned data from service should be stored in employees array.
Please help.