Use {}
in your arrow function
to define the scope and place the console.log in it.
Example
{
content.map( content => {
console.log(content);
return content.id
})
}
According to documentation .
The arrow function can have a "concise scope" or "block scope"
usual.
In a concise scope, only one expression is required and one return
implicit is attached.
In a block scope, you must use a
explicit return statement.
Example:
var func = x => x * x;
Concise, so you do not need a% implicit%
var func = (x, y) => { return x + y; };
This block needs an implicit%% as it is not concise.
In your example you can just add return
and put a return
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;
})
);
}