18 lines
421 B
TypeScript
18 lines
421 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { HttpClient } from '@angular/common/http';
|
|
import { Observable } from 'rxjs';
|
|
import { Employee } from 'src/typings';
|
|
import {map} from 'rxjs/operators';
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class EmployeesService {
|
|
|
|
constructor(private http: HttpClient) { }
|
|
|
|
getEmployees() {
|
|
return this.http.get<Employee[]>('http://localhost:3000/employees');
|
|
}
|
|
}
|