Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 文本在IE10中显示两次_Angularjs_Internet Explorer 10 - Fatal编程技术网

Angularjs 文本在IE10中显示两次

Angularjs 文本在IE10中显示两次,angularjs,internet-explorer-10,Angularjs,Internet Explorer 10,我正在用AngularJS开发一个带有下拉列表的应用程序。 作为下拉列表的默认值,我将其设置为选择目的。 它在Chrome、Firefox和其他IE浏览器中表现良好 仅在IE10中,它显示2个字符串,即选择目的选择目的 有没有人更早地面对过这个问题? 有人能告诉我为什么会发生这种情况,或者如何解决这个问题吗 以下是我的代码片段: <select id="purpose_combo" ng-model="selectedFile.data.purpose" class="form-contr

我正在用AngularJS开发一个带有下拉列表的应用程序。 作为下拉列表的默认值,我将其设置为选择目的。 它在Chrome、Firefox和其他IE浏览器中表现良好

仅在IE10中,它显示2个字符串,即选择目的选择目的

有没有人更早地面对过这个问题? 有人能告诉我为什么会发生这种情况,或者如何解决这个问题吗

以下是我的代码片段:

<select id="purpose_combo" ng-model="selectedFile.data.purpose" class="form-control"
            ng-disabled="selectedFile.purposeChoice == 'primary' || !selectedFile">
      <option selected hidden value="" translate>Select a Purpose</option>
      <option ng-repeat="item in purposeList" value="{{item}}"
              ng-selected="item == selectedFile.data.purpose">{{item}}</option>
</select>
谢谢

尝试使用ng选项:

<select id="purpose_combo" ng-model="selectedFile.data.purpose" class="form-control"
        ng-disabled="selectedFile.purposeChoice == 'primary' || !selectedFile"
        ng-options="item for item in purposeList">
  <option value="">Select a Purpose</option>
</select>

为什么需要选择默认选项和选择附加选项?你能试着移开吗?可能,角度ng模型将自行选择。