3

I'm creating a form where users can enter the person's information. I want to create a dropdown list for phone numbers and fax numbers for the given person, which the user may select the one they desire, i.e. if the numbers that they want is already stored in the database. However, the person may have additional phone number that may not be stored in the database. In that case, I want to allow users to be able to enter the new number. I found one that's close to what I want here, but it's not quite what I wished. I wish to do it using angular-material md-select, if possible.

<md-select ng-model="ctrl.phoneNumbers" ng-model-options="{ trackBy: '$value.id'}">
   <md-option ng-value="phoneNumber" 
              ng-repeat="phoneNumber in ctrl.phoneNumbers">{{ phoneNumber.number }}
   </md-option>
</md-select>
Community
  • 1
  • 1
user1828605
  • 1,723
  • 1
  • 24
  • 63
  • 1
    How about [Angular Material Autocomplete](https://material.angularjs.org/latest/demo/autocomplete)? – Yin Gang May 14 '16 at 03:54
  • That is a nice idea. Thank you. I was only thinking in one way, and didn' think about it at all. Can you add it as an answer so that I can mark it? – user1828605 May 14 '16 at 03:59

1 Answers1

7

Angular Material Autocomplete is really close to your case. Help it works.

Yin Gang
  • 1,443
  • 1
  • 10
  • 15