I have confusion in the second line. This code is working but I need to understand what it actually means.
export class EmployeeService {
employees!: EmployeeClass[]; // I think it should be *employees: EmployeeClass[] = [];*
constructor(private http: HttpClient) {}
getAll(): Observable < EmployeeClass[] > {
return this.http.get('http://localhost/website/employees_ng').pipe(
map((res: any) => {
this.employees = res['data'];
return this.employees;
}),
catchError(this.handleError));
}