I am attempting to use an array of objects
(array = [{name: \'Moe\', id:1}, {name: \'Larry\', id:2}, {name: \'Curly\', id:3}])
as a drop-
I would recommend using ng-options where you can.
Because check this out: You can use it to select actual objects:
app.controller('ExampleCtrl', function($scope) {
$scope.items = [
{ id: 1, name: 'Foo' },
{ id: 2, name: 'Bar' }
];
$scope.selectedItem = null;
});
{{selectedItem | json}}
In the above example when you select something from the drop down, it's actually setting an entire object reference on selectedItem rather that just a value type.
NOTE: using ng-options sets your value="" attributes to the indices of the items in your collections this is by design.
It's really the best way to do it.
EDIT: more context as requested. Also here's a plunker showing it in use