0

angular-chosen在我的角度应用程序中使用。我有一个模态,不同的输入和一个select chosen. 模态让用户添加或编辑人员信息。我的问题是在编辑模式下,chosen第一次没有显示选中的值。只是当我重新打开模式时,我才能看到选定的值。我验证了数据是否需要太多时间才能加载,但似乎是所选和模态的问题。这就是我显示它的方式:

 <select id="school" name="school" 
   no-results-text="'No data'" chosen
     disable-search-threshold="1" ng-model="person.school"
     ng-options="school as school.name + ' - ' + school.districtName + ' - ' + school.regionName  + ' - ' + school.cityName  for school in schools track by school.id">
          <option value="">&nbsp;</option>
   </select>
4

1 回答 1

0

您必须从控制器启动它,因为 ng-model未定义并且没有''或您要选择的值, person.school = '' 或者可能在ng-init="person.school = ''"选择标签中

于 2017-05-25T00:00:12.867 回答