0

I am trying to bind multiple options, within a select tag. My code thus far is as follows:

        <div class="form-group">
          <label for="children">Children</label>
          <select multiple [(ngModel)]='selectedMetric.children' id="children" name="children" class="form-control">
              <option [ngValue]="null" disabled>Metric children</option>
              <option *ngFor="let _metric of selectedModel.metrics" [ngValue]='_metric.name'>{{_metric.name}}</option>
            </select>
        </div>

Everything looks absolutely fine when I don't include 'multiple', the drop down works - everything works. When I include multiple / multiple="true", there is no longer a dropdown, and rather I get this:

What am I doing wrong here?

enter image description here

L Y E S - C H I O U K H
  • 4,765
  • 8
  • 40
  • 57
  • Got any error on the console? [This](https://stackoverflow.com/questions/35167463/angular2-how-bind-to-select-multiple) might be useful. – Jeto Mar 10 '18 at 11:09

1 Answers1

0

Nothing is wrong here. You don't get a drop-down on <select multiple ...

See https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select_multiple

Mrigank
  • 136
  • 1
  • 8