【问题标题】:webjar requirejs angular ie8 foreach loopwebjar requirejs 角度 ie8 foreach 循环
【发布时间】:2014-06-24 09:40:40
【问题描述】:

我无法使 requirejs 在 ie8 中与 angularjs 项目和 webjar 一起工作,(我在 firefox、chrome 中没有错误)。

使用 ie 调试栏出现此错误:

Object doesn't support property or method 

在这段代码中:

webjarsAngularjsChildren.forEach(function(child) {    
webjarsAngularjsPaths[child] = webjars.path("angularjs", child);
webjarsAngularjsShim[child] = ["angular", "webjars!angular.js"];
});

此代码是使用 requirejs/webjars 生成的

forEach 循环是否与 IE 8 兼容?

我该如何解决这个问题?

【问题讨论】:

  • 尝试较新版本的 Angular WebJar 和较新版本的 webjars-locator 库以取消此操作。
  • 如何设置 webjars-locator 的版本?我在 Angular WebJar 中使用最后一个版本:1.3.0-beta.2
  • 取决于你的构建工具是什么。文档可能会有所帮助:webjars.org/documentation
  • 我使用 "org.webjars" %% "webjars-play" %2.2.0,与 play 2.2.0
  • 添加:"org.webjars" % "webjars-locator" % "0.14"

标签: angularjs internet-explorer internet-explorer-8 requirejs webjars


【解决方案1】:

这里描述了这个问题: https://github.com/angular/angular.js/issues/5201

我在 IE11 的仿真模式下使用 IE8 时遇到了同样的问题。我安装了一个运行 Windows XP 的虚拟机和一个真正的 IE8 并且没有问题。

【讨论】:

  • 我在 windows Xp 环境中的真实 IE8 中有错误
  • 我在 webjarsAngularjsChildren.forEach 行中有这个错误:消息:Cet objet ne gère pas cette propriété ou cette méthode Ligne:262 Caractère:1
  • 好吧,如果你使用的是真正的 IE8,我不知道。在 forEach 方法内的 angular.js 中,为 IE8 明确指定了一个技巧
猜你喜欢
  • 2017-01-05
  • 2014-10-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-05-28
相关资源
最近更新 更多