1

I need to add option.lastname data along with option.name data inside option.

I found this way to convert the id to int works perfect but I am not being able to bring me the last name, it only leaves me one.

<select class="form-control" 
        ng-model="dog.owner_id" 
        convertToNumber  
        ng-change="selectOwner(dog.owner_id)" 
        ng-options="convertToInt(option.id) as option.name for option in owners">
   <option value="">Seleccione</option>
</select>

Before I had it like this but since I had to convert the ID to int it did not work for me:

<option value="@{{option.id}}" ng-repeat="option in owners">
      <b> @{{option.name}} @{{option.lastname}}</b>
</option>
charlietfl
  • 170,828
  • 13
  • 121
  • 150
Nachof1990
  • 11
  • 1
  • Note that ` – charlietfl Apr 07 '21 at 04:22
  • Does this answer your question? [Is it possible to concatenate values in Angular ng-options](https://stackoverflow.com/questions/20101793/is-it-possible-to-concatenate-values-in-angular-ng-options) – Pugazh Apr 07 '21 at 18:03

0 Answers0