I have an inconvenient create a rest api in Java
Where I want to consume it in angular
import { Injectable } from '@angular/core';
import { Http,Headers } from '@angular/http';
import { Observable, Subject } from 'rxjs';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
@Injectable({
providedIn: 'root'
})
export class SpotifyService {
constructor(private http: Http) {
console.log('Spotify Service Listo');
}
getAlbumHome(){
return this.http.get('http://localhost:2019/ServiciosWeb13/rest/servicioAlbum/listarAlbunes').
map(res=>{
return res.json();
});
}
/*
getAlbumSearch(termino: string){
return this.getQuery('buscarByAlbum?nombre=${termino}')
.map(res=>res.json());
}
getObtenerArtista(id:String){
return this.getQuery('obtenerMusica?id=${id}')
.map(res=>res.json());
}
getObtenerMusica(id:String){
return this.getQuery('obtenerMusica?id=${id}')
.map(res=>res.json());
}*/
}
But when executing my Angular project I get this error, I do not know how to solve it