【问题标题】:{{value}} is not getting resolved in IE{{value}} 在 IE 中没有得到解决
【发布时间】:2014-11-07 10:42:30
【问题描述】:

JSON

[
  {
    "1": "January",
    "2": "February",
    "8": "August",
    "9": "Septemeber",
    "10": "October",
    "11": "November",
    "12": "December"
  },
  {
    "2": "February",
    "3": "March",
    "4": "April",
    "5": "May",
    "6": "June",
    "7": "July",
    "8": "August"
  }
]

HTML:

<select class='W1_Normal V4 A_{{$parent.$index}}' style="width:100px;" id="A_{{$parent.$index}}_{{$index}}"  name="A_{{$parent.$index}}_{{$index}}" onchange="modifiyOtherDropDowns(this);removeErrorMessagesOfAllLowerDivsUsingObj(this)">
    <option value=""></option>
    <option ng-repeat="(key, value) in ap" value="{{key}}">{{value}}</option>
</select>

在 Firefox 和 Chrome 中,上面编写的代码工作正常,{{value}} 正在解析相应的值。但在 IE 中,{{value}} 显示为 {{value}}

更新:IE8 特有的问题

【问题讨论】:

  • 不要使用 ngRepeat 来构建选择,使用ngOptions
  • 您可以使用 ng-class 将模型绑定到 css 类。 IE 是否在 F12 中显示 javascript 错误?
  • 你检查过这里的所有步骤吗docs.angularjs.org/guide/ie
  • @Yoshi 我知道,我使用 ng-repeat 犯了一个错误。但这与我面临的问题有什么关系吗?
  • IE 兼容模式可能是问题所在。 stackoverflow.com/questions/3449286/…

标签: javascript angularjs


【解决方案1】:

您应该阅读此article about using Angular with IE8 and earlier。您需要了解一些技巧。每当我使用 Angular 定位 IE8 时,我都会避免编写元素指令,而是坚持使用属性指令。

【讨论】:

  • 我同意你的观点,但这并不能回答我的问题。
  • 我认为在这个链接点 4 是你问题的答案
  • 是的 Ahmer,确实如此。但是看到使用 ng-repeat 也是正确的方法。它是 IE8 引擎,其中有一些错误,这就是为什么它不能正确渲染 {{variable}}。
  • 而不是 ng-repeat 尝试ng-options click here 以查看更多详细信息
猜你喜欢
  • 1970-01-01
  • 2020-10-14
  • 2013-09-30
  • 2019-07-18
  • 2011-01-14
  • 2022-01-16
  • 2017-04-27
  • 1970-01-01
  • 2021-05-14
相关资源
最近更新 更多