I seem to get an error with webpack compiling. It compiles if I remove .data
but then the page blows up with the calls from template->component (which calls a service
Error I am getting
ERROR in src/app/components/app-landing-page/app-landing-page.component.ts(95,41): error TS2339: Property 'data' does not exist on type 'Response'.
webpack: Failed to compile
That is when my component has
this.referrals = result.data;
component:
this.arsSevice.getArsCodesApi(this.model)
.subscribe(
result => {
this.referrals = result.data;
console.log('component',result);
})
Service:
getArsCodesApi(search: arsCodes) {
return this.http.post(this.serviceUrl, JSON.stringify(search), httpOptions)
JSON.stringify(search), options)
.map((response: Response) => {
return response;
})
}
FYI http is the new httpclient
Once I compile it without .data -- running with ng serve --open
then i have to add .data back in
If I don't add it, the call fails to work and i get this error
Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
WHY??? ( console.log clearly shows that that is data : Array(16) )
Edit Update showing console.log of data