my map/filter function aren't returning an object that I am recieving from my in-memory-service.
this.myService.getEventMedia().subscribe(
(response) => {
return response.map((res) => {
this.returnObj = res.dataObj.filter((data) => {
if(data.id === id) {
console.log('event is ', data)
return data;
}
})
})
}
);
after this response and/or ngAfterViewInit() returnObj is console logging undefinded. My data from the filter function has value in it and i can console log data.id
my model looks like below
export interface Model {
id: number;
name: string;
data: Data[];
}
subscribe
block. What are you trying to accomplish?response
?filter
insidemap
is not a good idea, though