在 ng-admin 编辑视图中,我需要使用 id 更改文件上传 url,如下所示,但我不知道如何在 uploadInformation 基础 url 中获取所选实体的 id,例如 {{entry.values.id}},下面是我的代码:
files.editionView()
.title('Edit File {{ entry.values.id }}({{ entry.values.filePath}})') // title() accepts a template string, which has access to the entry
.actions(['list', 'show', 'delete']) // choose which buttons appear in the top action bar. Show is disabled by default
.fields([
nga.field('id').label('id').editable(false),
nga.field('file', 'file').uploadInformation({ 'url': baseurl +"files/upload/{{entry.values.id}}"}),// fields() without arguments returns the list of fields. That way you can reuse fields from another view to avoid repetition
])