3
How the select is validated using the ng-required="true"
?
For input I’m putting like this:
<form name="tarefasForm">
<input type="text" ng-model="tarefa.solicitante" ng-required="true" name="solicitante-tarefa">
</form
<button ng-click="adicionaTarefa()" type="button"
ng-disabled="tarefasForm.$invalid">Salvar
</button>
How’s it time for a select?
<div class="form-group">
<label class="" for="orderBy">Tipo</label>
<select ng-options="tipoTarefa as tipoTarefa.tipo for tipoTarefa in listaTipoTarefa track by tipoTarefa.codigo" ng-model="tarefa.codTipo" class="form-control cb"></select>
</div>
If I’m not mistaken, you just need to add one
option
when select with empty value -value=""
.<option value="">Selecione uma opção</option>
– Pedro Camara Junior
What you need to know, specifically?
– Jéf Bueno