ionic-modal-select
ionic-modal-select copied to clipboard
Selected option in template
Using <div class="option">{{option....}}</div>
one can access all properties of option
to build the selection list display.
One can also use option-property
or option-getter
to get/build the ngModel value.
But then, one can't get a handle on the selected option
.
It would be nice to have the selected option, if any, available in scope inside the directive so one can build a proper display of the selected option out of the modal.
Something like:
<some-element modal-select
ng-model="myModel.someRelationship
options="myOptions"
option-property="id">
<div class="option">{{option.firstName}} {{option.lastName}}</div>
<div ng-if="!myModel.someRelationship">Please select something</div>
<div ng-if="myModel.someRelationship">{{selected.firstName}} {{selected.lastName}}</div>
</some-element>
What do you think?
hi @eskatos, makes sense to me, and should be quite easy to implement. thanks for the idea, I will add this feature ASAP.
best regards Mauro