internet-explorer-8 - 为什么 ng-class ="ng-app"会破坏 AngularJS?

标签 internet-explorer-8 cross-browser internet-explorer-7 angularjs

为了让 AngularJS 在 IE7 和 IE8 中工作,我将 id="ng-app"和 class="ng-app"添加到我的 ng-app 元素:

<html id="ng-app" class="ng-app" ng-app="myApp">
   <div ng-view></div>
</html>

这在过去一直有效,但现在我已将 class="ng-app"添加到两个不同的项目中,并且在这两个 View 中都不再在任何浏览器中呈现。实现 IE7/8 兼容性的方式有变化吗?我使用的是 CDN 的 1.0.2 版。

谢谢你。

最佳答案

编辑说明:添加 doctype 标签会减少一些问题。
谢谢@Mike Pateras

 <!doctype html>

原来的:

尝试这个
<html lang="en" class="ng-app:myapp" id="ng-app" ng-app="myapp" xmlns:ng="http://angularjs.org">
     <head>    
        <!--[if lt IE 9]>
          <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
        <!--[if lte IE 8]>
          <script>
            document.createElement('ng-include');
            document.createElement('ng-pluralize');
            document.createElement('ng-view');
            document.createElement('ng:include');
            document.createElement('ng:pluralize');
            document.createElement('ng:view');
          </script>
        <![endif]-->
        <!--[if lt IE 8]>
          <script src="https://cdnjs.cloudflare.com/ajax/libs/json2/20150503/json2.min.js"></script>
        <![endif]-->
      </head>

关于internet-explorer-8 - 为什么 ng-class ="ng-app"会破坏 AngularJS?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13184063/

相关文章:

javascript - 如何强制 IE 重新加载 javascript?

css - IE8 : Disable cleartype?

javascript - $(window).resize() 在 safari : why it works also if scroll window (but doesn't resize)?

javascript - ie7 没有加载我的样式表

javascript - W3schools 上 AJAX 示例的问题

performance - IE 8.0.7600.16385IC 中的 SSL 速度慢

iphone - 在没有 iPhone/Mac 的情况下为 iPhone 开发网站

css - IE8兼容性问题

javascript - 如何使用 JavaScript 禁用滚动条?

javascript - IE 7 和 8 中的 contenteditable 更改事件