Good afternoon, I am creating an angular 14 form and I need it to select but its options are filled with data that comes from a database query and it comes in this way
[
{
"nombre": "devNoob",
"value": 10
},
{
"nombre": "devNoob2",
"value": 11
}
]
and in this way I have to fill my select, this was what I did at first
datosSelect: Object;
llenarDatosSelect():void {
const datosArr: Array<Object> = respuesta /*respuesta serian los datos de la DB*/
datos.push(obj => {
this.datosSelect = obj;
})
}
but in the HTML I don't know what to put for this to work try to do this
<select>
<option value="{{datosSelect.value}}">{{datosSelect.nombre}}</option>
<option value="{{datosSelect.value}}">{{datosSelect.nombre}}</option>
<option value="{{datosSelect.value}}">{{datosSelect.nombre}}</option>
<option value="{{datosSelect.value}}">{{datosSelect.nombre}}</option>
</select>
but let's see... first I don't know how much data will come this may vary apart I don't know why I thought this was going to work hahahaha: V, thanks for your help.