Looking to retrieve and read an SVG file in Angular 6 from the assets folder as a string. I've attempted the following:
this._htmlClient.get('../../assets/images/chart1.svg').subscribe(data => {
console.log('svg-file: ', data);
});
Unfortunately, this approach is not working as expected. The console log does not display and an error occurs.
ERROR HttpErrorResponse {headers: HttpHeaders, status: 200, statusText: "OK", url: "http://localhost:4200/assets/images/chart1.svg", ok: false,
The file path seems correct as it loads when pasted directly into the browser.
Any suggestions on how to successfully load the file content as a string?