Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

123
Vistas
md-autocomplete when selecting a dropdown item object it says [Object Object]
        <md-autocomplete
            required
            md-input-class="OfficialClass"
            md-selected-item="selectedOfficial"
            md-search-text="searchText"
            md-items="item in findOfficials(searchText)"
            md-item-text="item.user.display_value"
            md-no-cache="true"
            md-search-text-change="searchTextChange(searchText)"
            md-selected-item-change="selectedItemChange(item.name.value)"
            md-floating-label="New Official"
            md-min-length="3"
            md-autofocus md-autoselect>
          <md-item-template>
            <span md-highlight-text="searchText" md-highlight-flags="^i"> 
             {{item.name.display_value}} - {{item.email.display_value}}</span>
          </md-item-template>
        </md-autocomplete>
      </div> 
      <md-dialog-actions>
        <md-button ng-disable="required" class="md-primary md-raised" aria-label="Submit" ng- 
          click="submitO(selectedOfficial)">Submit Request</md-button>
       \</md-dialog-actions>

I have this autocomplete and right now selectedOfficial returns [Object Object] in my drop down once I select an option. The drop down options as of now display perfectly, the name and email. But once I select the user, I want only the users name to show as the final selected option. Right now I am using selectedOfficial in my method submitO because it has an associated sys_ID with it that i need to reference.

so the selectedOfficial object looks as so:

{
    "sys_id": {
        "display_value": "12345",
        "value": "1234"
    },
    "name": {
        "display_value": "joe bob",
        "value": "joe bob"
    },
    "email": {
        "display_value": "joebob@email.com",
        "value": "joebob@email.com"
    }
}

right now when I hit submitO, it references selectedOfficial and I use the sys_id for a call that I need.

so the question here is, how do I make the dropdown say the display name

I tried md-selected-item="selectedOfficial.name.value" and it still says [Object Object] I even tried item.name.value in the md-select and it still does [object object]

is there some sort of hacky way I can make the dropdown say the objects name value??? I am very stuck and need some help on this its the last piece of the puzzle that I cannot figure out. thanks in advance

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

md-item-text="item.user.display_value" should be item.name.display_value

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda