0

Is there any recommended method on Angular 10+ to load the HTML and CSS for a component from an HTTP call to a web API? I try this code

<div [innherHtml]="bodyHtml | async"></div>

my component:

bodyHtml: any
constructor() {
 this.bodyHtml = yourContentService.GetContent()
}

my service:

GetContent() {
    const uri = `http://localhost:3000/api/books/`;
    return this.http.get(uri, {headers :{'Accept': 'text/html', 'responseType': 'text' as 'json'}});
  }

but I got this error: message: "Http failure during parsing for http://localhost:3000/api/books/" I need help plz and thank you.

Haythem Hedfi
  • 569
  • 1
  • 5
  • 11

0 Answers0