angularjsng-admin

ng-admin filters change key


I want to change the search fields on the filter (list view). This is the code :

filters([
          nga.field('project', 'reference')
                .label('Project')
                .targetEntity(project)
                .targetField(nga.field('nome'))
                .remoteComplete(true, {
                    refreshDelay: 200,
                    searchQuery: function(search) { return { q: search }; }
                })
        ])

But the query is http://localhost:3000/days?_order=DESC&_sort=id&admin=1&limit=30&offset=0&project=138475ABC48

I want the name of the project in the query not the ID.

Any suggestion ? Thank you!


Solution

  • .targetEntity(nga.entity('projects').identifier(nga.field('name')))