0
Here I take all the employees of the company (this is correct, I already do on another page of the application and pull the data straight by . getFunctionaries)
setConsultores(){
this.userService.getFuncionarios()
.subscribe(response => {
this.funcionarios = JSON.parse(JSON.stringify(response))
this.allFuncionarios = this.funcionarios
for (let funcionario of this.allFuncionarios) {
this.allFuncionarios.push(funcionario)
}
})
}
Already on the front, I put select this way
<strong>Selecione um consultor para atender a empresa:</strong>
<select class="form-control" name="consultorSelected" id="consultorSelected" (ngModelChange)="setConsultores()">
<option *ngFor="let funcionario of allFuncionarios" value="{{funcionario.id}}">{{funcionario.nome}}</option>
</select>
However, you are not pulling these values, in case I just want the name of the employee to appear and the value is the ID of the selected employee.
But there is some error in the console?
– LeAndrade
none, I tried to put the call of the function setConsultores() in ngOnInit, then it ends up loading the page a lot and hangs.
– Vitor Ezequiel