as title, I have a dropdown menu that get populated automatically instead of having many <option value> (that was my first task to complete), so I completed my first by using this code:
<select cSelect id="idColor" [(ngModel)]="color">
<option disabled>Choose...</option>
<option *ngFor="let color of colors" [(ngModel)]="color.idColor">{{color.colorName}}</option>
</select>
Well, I now have a second task to complete, and I'm unable to understand where am I doing wrong, since I didn't familiarised yet with this language bases, I have a generated service .ts file containing this code:
public getColors(): Observable<any> {
return __request(OpenAPI, this.http, {
method: 'GET',
url: '/api/Colors/colors',
});
}
Well I should use this method getColors() for getting rid of this, since this data should be obtained by an api request:
colors = [
{
"idColor": "1",
"colorName": "White"
},
{
"idColor": "2",
"colorName": "Yellow"
},
{
"idColor": "3",
"colorName": "Orange"
}
Do someone have an idea on how should I proceed?