为什么NG-CLASS =" NG-应用"打破AngularJS? [英] Why does ng-class="ng-app" break AngularJS?
本文介绍了为什么NG-CLASS =" NG-应用"打破AngularJS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
要获得AngularJS在IE7和IE8的工作,我添加了ID =NG-应用和class =NG-应用程序我的NG-app元素:
To get AngularJS to work in IE7 and IE8, I add id="ng-app" and class="ng-app" to my ng-app element:
<html id="ng-app" class="ng-app" ng-app="myApp">
<div ng-view></div>
</html>
本一直在过去的工作,但现在我已经添加类=NG-应用程序,以两个不同的项目,并在这两个视图不再在任何浏览器渲染。要做的IE7 / 8兼容的方式改变了吗?我使用的版本1.0.2从CDN。
This has always worked in the past, but now I've added class="ng-app" to two different projects, and in both the view no longer renders in any browser. Has the way to do IE7/8 compatibility changed? I'm using version 1.0.2 from the CDN.
感谢您。
推荐答案
的编辑注:的加入DOCTYPE标签会减少一些问题。
感谢@Mike PATERAS
Edit note: Add doctype tag will reduce some issues. Thanks @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>
这篇关于为什么NG-CLASS =&QUOT; NG-应用&QUOT;打破AngularJS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文