-1
I have this method of consultation dependent on State and City. I can save and consult. When I go on the update screen, type 'RJ / Angra dos reis', it does not appear on the screen if I go on the screen and click on another state and then go back to RJ, then the city appears that it was recorded. can tell me if my code is missing something?
<label for="UnidadeFederativa">Unidade Federativa</label>
<select class="form-control" ng-model="usuario.IdUnidadeFederativa" ng-init="consultarUnidadeFederativas()" ng-change="consultarCidades(usuario.IdUnidadeFederativa)">
<option value="{{f.IdUnidadeFederativa}}" ng-repeat="f in unidadeFederativas"
ng-selected="f.IdUnidadeFederativa == usuario.IdUnidadeFederativa">
{{f.Sigla}}
</option>
</select>
<!--Cidadessss-->
<label>Selecione a Cidade:</label>
<select class="form-control" ng-model="usuario.IdCidade" ng-init="consultarCidades()" ng-change="consultarBairrosParametros(usuario.IdCidade)">
<option value="{{c.IdCidade}}" ng-repeat="c in cidades"
ng-selected="c.IdCidade == usuario.IdCidade">
{{c.Nome}}
</option>
</select>
Try using select with ng-options, type like <selects ng-model="user.Idunidfederative" ng-options="f. Acronym for f in unitFederativas"> </selects>
– Levyh Nunes
Good morning buddy, I added ng-options in select no longer carried the name of the saved city .
– Vanderlei Campos
passes the controller code so you can check better, the more details the better
– Levyh Nunes
ok. I’ll post .
– Vanderlei Campos