I need to link complex objects using a select box.
I know ng-options , but I cannot use the template expression in ng options. I would need to add a field with displaytext for each object in my controller, as in this fiddle . This would mean that I would need to change the logic / code for the presentation. This is a poor separation of concerns.
Is it possible to associate complex objects with a selection field not using ng-options? I need to write declarative text in a template, for example:
<select name="myObject" ng-model="myObject.sub">
<option ng-selected="!myObject.sub.id"></option>
<option value="" translate="myObject.sub.self" ng-selected="myObject.sub.id == -1">
<option ng-repeat="option in subselect.data" value="{{option}}" ng-selected="option.id == myObject.sub.id">
{{option.id}} {{option.shortName}} {{ option.comment }}
</option>
</select>
this currently binds the string [object Object]due to interpolation in the value attribute.