Прежде всего, я получаю эту ошибку, когда делаю запрос.
SyntaxError: Unexpected token � in JSON at position 0
at JSON.parse (<anonymous>)
at XMLHttpRequest.onLoad (http://localhost:8100/vendor.js:9848:51)
at ZoneDelegate.invokeTask (http://localhost:8100/polyfills.js:3722:31)
at Object.onInvokeTask (http://localhost:8100/vendor.js:71849:33)
at ZoneDelegate.invokeTask (http://localhost:8100/polyfills.js:3721:60)
at Zone.runTask (http://localhost:8100/polyfills.js:3499:47)
at ZoneTask.invokeTask [as invoke] (http://localhost:8100/polyfills.js:3796:34)
at invokeTask (http://localhost:8100/polyfills.js:4934:14)
at XMLHttpRequest.globalZoneAwareCallback (http://localhost:8100/polyfills.js:4971:21)
Я вижу нужное изображение, когда нажимаю на вкладку сети. Это мой запрос.
let head= new HttpHeaders;
head.append('reid', id);
head.append('responseType', 'image');
this.http.get('http://127.0.0.1:8000/getimg', {headers: head}).subscribe(result => {
this.data = result;
console.log("was : " ,id);
console.log(this.data);
}, error => console.error(error));
Следующее, что я хочу сделать, - это показать изображение на странице details.page. html. Как я могу это сделать?