Comment

CMR

Any idea how to get the data from a data object into the select? Every example I see has the $scope of the select model defined as an array, and I can't seem to figure out how to do this with data objects instead.

Meaning, instead of:

$scope.choice = [
    { name: "Thing1", value: "thing1" },
    { name: "Thing2", value: "thingt2" },
    { name: "Thing3", value: "thing3" }
];

what I would want is some way to make it:

$scope.choice = _.each(thing-name, thing-id in thing);

or whatever, where "_.each" is each "thing" (so all "things" are listed); "thing" is the data object and thing-name and thing-id are two of its properties. But HOW? I can't seem to figure out HOW. Nothing I try is working....

Replies

Peter Bengtsson

Are you using ng-select or an ng-repeat on the <option> tag?