ionic-modal-select icon indicating copy to clipboard operation
ionic-modal-select copied to clipboard

Selected option in template

Open eskatos opened this issue 8 years ago • 1 comments

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?

eskatos avatar Mar 27 '16 15:03 eskatos

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

bianchimro avatar Mar 27 '16 17:03 bianchimro