misc/src/app/api/employees.service.ts
2019-09-12 16:52:35 +02:00

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');
}
}