使用IE时AngularJS v1.2.16的bug?

时间:2014-10-14 13:16:14

标签: javascript jquery angularjs

这段代码:

  if (window.angular.bootstrap) {
    //AngularJS is already loaded, so we can return here...
    console.log('WARNING: Tried to load angular more than once.');
    return;
  }

包含在AngularJS 1.2.26版中,导致IE出现问题。错误消息是"控制台未定义"。我的修复只是删除console.log

window.angular.bootstrap的含义是什么?

1 个答案:

答案 0 :(得分:0)

正如其他人在评论中所说的那样,对console对象的支持,特别是console.log对某些版本IE的支持并不好,所以这就是你得到这个错误的原因。有许多用于记录的polyfill,such as this one。虽然,这不是你的问题。

您首先运行此代码的原因是因为window.angular.bootstrap null或未定义,这意味着您不止一次加载Angular JS。

相关问题