import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Photo } from './photo';
@Injectable({providedIn: 'root'})
export class PhotoService {
constructor(private http: HttpClient){
this.http = http;
}
listFromUser(userName: string){
return this.http.get<Photo[]>(API + '/' + userName + '/photos');
}
}
Meu código está dando erro na "API", por que?