Skip to content

Conversation

@JacerOmri
Copy link

Add basic formatter for embedded_list fields
It would map the array items to the value of the first target field configured

remyburel pushed a commit to remyburel/ng-admin that referenced this pull request Oct 28, 2016
Copy link
Contributor

@jpetitcolas jpetitcolas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I got a comment about your code. Moreover, can you add some unit tests? :)

return function (entry) {
return {
name: label,
value: entry.values[field.name()].map((obj => obj[field.targetFields()[0].name()]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps would it be more coherent to use the same value as for the reference_many?

value: entry.listValues[field.name()].join(', ')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants