I'm new to Angular, and I try to build a web following a tutorial. But it said the way I use subscribe is too old, could you help me to change it?
**
employees: Employee[] = []
constructor(private employeeService: EmployeeService){}
public getEmployees():void {
this.employeeService.getEmployees().subscribe(
(res:Employee[])=>{
this.employees = res
},
(error:HttpErrorResponse)=>{
alert(error.message)
}
)
}
**