my question is this: -Because I receive error 403 in firebug when wanting to represent an image ?. The application is being made with MEAN Stack.
getArtist(token, id: string){
let headers = new Headers({
'Content-Type' : 'application/json',
'Authorization': token
});
let options = new RequestOptions({headers: headers});
return this._http.get(this.url + 'getOneArtist/'+ id, options).map(res => res.json());
}
That is the method for the artist service. And I want to put your corresponding image. The fact is that in principle everything has gone well so far, since I have headers in the back-end. CORS.
<div class="image-for-edit" *ngIf="artist.image && artist.image != 'null'">
<img src="{{url + 'getImageArtist/' + artist.image}}">
</div>
Here is the HTML.
And finally, the controller method:
getArtist(){
this._route.params.forEach((params: Params) => {
let id = params['id'];
this._artistService.getArtist(this.token, id).subscribe(
response => {
if(!response.artist) {
this._router.navigate(['/']);
}else{
this.artist = response.artist;
}
},
error => {
var errorMessage = <any>error;
if(errorMessage != null) {
console.log(error);
}
}
);
});
}
Any clue as to why all the places where I want to put an image have not had a problem, and here?
Thanks in advance. Greetings.