Get the key "description of a typeahead angularjs

2

I have a form where I search with the name or code of municipalities all over Brazil. After doing this query, I only display in the input the code of this search.

I need to get the "description" generated in this input, to load it into another input.

  <input name="municipiosServico" id="municipiosServico" type="text" required ng-model="contribuinte.codLocalPrestacaoServico"
                           typeahead="municipiosServico.codigo as municipiosServico.descricao + ' - ' + municipiosServico.uf for municipiosServico in municipiosBr | filter:$viewValue | limitTo:8"
                           class="form-control"/>

In the first input display municipalitiesServico.codigo and in the second I need to display the municipiosServico.descricao.

I was trying to get through the municipalitiesServico.codigo , to go to the bank and return with the name of the municipality, but it would be very costly in terms of application performance.

    
asked by anonymous 28.11.2018 / 14:40

0 answers