I am new to angular-4 and I want to read a csv file from angular-4 assets directory, file size 5mb and I dont\'t want to read this file from django back-end server because this
In case you use the new HttpClient class (@angular/common/http), then you will have to set the responseType to 'text', otherwise the HttpClient class would try to interpret the content as json and raise a SyntaxError...
e.g.:
this.http.get('assets/file.csv', {responseType: 'text'})
.subscribe(
data => {
console.log(data);
},
error => {
console.log(error);
}
);