0

Have a simple CRUD app. Use $resource.

object

{
    name: 'name',
    url: 'some.api.com/api/customer/12334723847892347qw89e798/'
}

Query get all objects,

customersList = customersService.customerResource.query();

and i make select from this list

<select name="" 
        ng-options="item.name for item in customersList track by item.url" 
        ng-model="project.customer">
</select>

but then i send from, have error, API need url string from selected object in project.customer. But this select send object (dictionary).

How tell angular get only url porp?

macgera
  • 399
  • 1
  • 3
  • 10
  • 3
    `item.url as item.name for item in customersList`. Checkout the official documentation. – PSL Jan 12 '15 at 22:39
  • I try read, and use this code: `item.url as item.name for item in controller.customersList track by item.url` But, i have empty first element in DOM. `` – macgera Jan 12 '15 at 23:20
  • http://stackoverflow.com/questions/17329495/how-to-use-ng-option-to-set-default-value-of-select-element – PSL Jan 12 '15 at 23:21

0 Answers0