Select component with ng-model, relationship between tables

1

I have a select component

<div  class="form-group col-md-4">
        <label>Município:</label> 
        <select ng-model="distrito.entidade.id.municipio.id.nome"  class="form-control"  >
            <option value="{{mun.id}}"  ng-repeat="mun in municipios " >{{mun.nome}}</option>   
        </select>
</div>

and I want to bring the name of the municipality that is inside the municipality table this inside the entity table that is related to the district table where the component is.

PS: The information is correctly arriving from the controller.js of the screen because the debug was done.

    
asked by anonymous 27.09.2017 / 22:10

1 answer

0

I was able to solve by changing value and ng-repeat

<div class="form-group col-md-4">
    <label>Município:</label>
        <select ng-model="distrito.entidade.municipio.id" class="form-control">
            <option value="{{dis.idEntidade.idMunicipio.id}}" ng-repeat="dis in distritos">{{dis.idEntidade.idMunicipio.nome}}</option>
        </select>
</div>
    
28.09.2017 / 15:22