我正在尝试获取一些使用 angular-ui bootstrap 的 AngularJS 代码在 IE 8 中工作。我正在使用 AngularJS developer guide on IE 中的指南.我将以下代码添加到我的 index.html 页面:
<!doctype html>
<html xmlns:ng="http://angularjs.org" id="ng-app" ng-app="plunker">
<head>
<!--[if lte IE 8]>
<script src="//cdnjs.cloudflare.com/ajax/libs/json2/20130526/json2.js"></script>
<script>
document.createElement('alert');
document.createElement('ng-include');
document.createElement('bookviewer');
document.createElement('accordion');
document.createElement('accordion-group');
document.createElement('accordion-heading');
</script>
<![endif]-->
:
问题是:我无法让它工作...以上几行是完整代码集的一部分,该代码集太大而无法包含在此处。我在 https://github.com/svdoever/AngularJS-bookviewer 上将完整的代码添加到 github 存储库中。 . 是不是我忘记了什么,或者 AngularJS+angular-ui bootstrap+IE8 是永远行不通的组合?
我将示例的一个版本部署到 http://svdoever-playground.azurewebsites.net/ .
最佳答案
我通过添加 augment.js 解决了这个问题。 https://github.com/javascript/augment 问题是 bootstrap.js 使用的是 IE8 没有实现的 JS 函数。 Augment.js 正好填补了空白。
关于javascript - 带有 angular-ui Bootstrap 的 AngularJS - 使其与 IE8 兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21555553/