Each time I attempt to use {{requestType: 'text'}} within my http.get(url) call, an error occurs stating that only arrays and iterables are allowed for diffing. However, I am converting my object into an array. I need help understanding this issue and finding a solution.
When I exclude the RequestType, the array comes through without any problems and is displayed on my front end.
----service-----
getAll(){
const requestOptions: Object = {
/* other options here */
responseType: 'text'
}
return this.http.get<any>(this.url, requestOptions);
}
---component .ts-----
notificationsFass: any[];
constructor(route: ActivatedRoute, private metaService: Meta, private notificationService: NotificationsFassService) {
this.notificationsFass = [];
}
ngOnInit() {
this.notificationService.getAll()
.subscribe(notificationsFass => {
this.notificationsFass = notificationsFass;
}
);
}
---html---
<div *ngFor="let m of notificationsFass">
---error----
ERROR Error: Error trying to diff '[{"incidentNumber":700,"createdByName":"FASS Notification","createdDate":"2019-03-27T09:18:15.000+0000"}]'. Only arrays and iterables are allowed