Utilize {}
in his arrow function
to set the scope and put the console.log inside it.
Example
{
content.map( content => {
console.log(content);
return content.id
})
}
According to the documentation.
The Arrow Function may have a "concise scope" or "block scope"
usual.
In a concise scope, only one expression is needed and one return
implicit is attached.
In a block scope, you should use a
explicit return instruction.
Example:
var func = x => x * x;
Concise, so you don’t need a return
implicit
var func = (x, y) => { return x + y; };
This block needs a return
implicit because it is not concise.
In your example you can just add {}
and put a console.log
before
findToOptions(searchValue: string): Observable<any[]> {
return this.findAll(new PageParameters(15, 0, 'id,asc'), this.getSearch(searchValue),
this.fields.toString(), true)
.pipe(
map(page => {
console.log(page.content);
return page.content;
})
);
}