Hello, I'm wondering if this is possible.
For example, I have a dropdown with a JSON array of strokes in ng-options
:
<select name="curso" ng-options="curso.cursoId.sigla + ' - ' + curso.cursoId.periodo for curso in cursos" class="form-control" ng-model="disciplina.curso" required>
<option value="">Selecione o curso</option>
</select>
When I edit a course, ng-model
disciplina.curso
already has a course object, so the idea is that the course that is in that model will already appear selected in the dropdown when I open the form instead of "Select one course. "
Is there any feature of ng-options
itself that allows me to do this? Or do I need to create a role or policy? I do not have much experience with AngularJS, so I'm not sure how to proceed.
Thank you in advance!