I am starting with Angular and I need to convert an application from Silverlight to Angular, and when I check some checkboxes, some selects or comboboxes appear.
Having reference to this page where they place how to add or modify controls (textboxes)
The code that I think is to add select or comboboxes is the one that I indicate:
private addCheckboxes() {
this.orders.map((o, i) => {
const control = new FormControl(i === 0); // if first item set to true, else false
(this.form.controls.orders as FormArray).push(control);
});
} but how do I indicate that they are selects?
You can achieve what you want with
[(ngModel)]
In your component you create a variable:
And in your
html
add the following:Then you can do it progressively with a
*ngFor
.Here is a working example