Aplicação Angular tentando preencher as opções em um select com resultados de uma chamada de API:
<select class="select input input-bordered" formControlName="student" (change)="onStudentChange($event)" >
<option *ngFor="let student of students" value="{{student._id}}">{{ student.name }}</option>
</select>
ngOnInit:
ngOnInit(): void {
this.userService.getStudentsByUser(this.authService.currentUserSig()?._id!).subscribe((response) => {
this.students = response;
});
}
O que estou perdendo aqui? Ao depurar localmente e salvar o arquivo HTML, ele preenche magicamente, mas desaparece ao atualizar.