AngularJS select box options disappear when an item is selected

前端 未结 1 1476
粉色の甜心
粉色の甜心 2021-02-01 17:03

I have created a select box bound to a model using Angularjs. The select box options load correctly but as soon as select any single option all options disappear from the select

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-01 17:48

    The problem is that the ng-model on your select element overwrites the $scope.appointments array as soon as an item is selected. Use a different scope property for your ng-model value.

    Here's an updated plunker: http://plnkr.co/edit/EAExby

    The changes to your template would be:

    {{selectedAppointment}}

    0 讨论(0)
提交回复
热议问题