import { Injectable } from '@angular/core' ; import { HttpClient } from '@angular/common/http' ; import { User } from '../_models/index' ; @ Injectable ( ) export class UserService { constructor ( private http ) { } getAll ( ) { return this . http . get < User [ ] > ( '/api/users' ) ; } }