I have just started with Angular2 and I\'ve got an issue I cannot really understand.
I have some mock data created as such:
export const WORKFLOW_DAT
The return type if your method is Observable
. So when you subscribe, that will be the type passed. And there is no testDataArray
on the Object
type. You can do a couple things:
Type the data and return type differently
WORKFLOW_DATA: { testDataArray: any } = []
getWorkflowForEditor(): Observable<{ testDataArray: any }>
Or just type assert the response data to any
console.log( (WORKFLOW_DATA).testDataArray );