I'm building% complete%, and at the time of editing, I'm having a problem with CRUD
. To save, I have a form with a ng-repeat
and select
that contains the functions that a collaborator can have (Coordinator, supervisor, teacher, etc). So far so good, it saves everything in the bank, with the id of the function. But at the time of editing, it fills this form with all the information, minus the ng-repeat
with the select
, which is "empty". I need to leave ng-repeat
with the pre-selected value with the value of the id that comes from the bank, but I'm not getting it.
This is my select
with select
<div ng-controller="funcoesController">
<div class="form-group error">
<label for="inputFuncao" class="col-sm-3 control-label"> Função </label>
<div class="col-sm-9">
<select name="funcao" ng-model="colaborador.funcao_id" ng-required="true">
<option ng-repeat="f in tbfuncao" value="{{f.id}}">
{{f.descricao}}
</option>
</select>
</div>
<span class="help-inline"
ng-show="frmColaboradores.funcao.$invalid && frmColaboradores.funcao.$touched">
Função do colaborador é obrigatória </span>
</div>
</div>
I do not know what code I should put here, if I need more, just ask ... Thanks in advance for your help.