@@ -15,33 +15,54 @@ To make your Angular application work on IE please make sure that:
15
15
1. You polyfill JSON.stringify if necessary (IE7 will need this). You can use
16
16
[JSON2](https://github.com/douglascrockford/JSON-js) or
17
17
[JSON3](http://bestiejs.github.com/json3/) polyfills for this.
18
-
19
- 2. you **do not** use custom element tags such as `<ng:view>` (use the attribute version
18
+ <pre>
19
+ <!doctype html>
20
+ <html xmlns:ng="http://angularjs.org">
21
+ <head>
22
+ <!--[if lte IE 8]>
23
+ <script src="/path/to/json2.js"></script>
24
+ <![endif]-->
25
+ </head>
26
+ <body>
27
+ ...
28
+ </body>
29
+ </html>
30
+ </pre>
31
+
32
+ 2. add `id="ng-app"` to the root element in conjunction with `ng-app` attribute
33
+ <pre>
34
+ <!doctype html>
35
+ <html xmlns:ng="http://angularjs.org" id="ng-app" ng-app="optionalModuleName">
36
+ ...
37
+ </html>
38
+ </pre>
39
+
40
+ 3. you **do not** use custom element tags such as `<ng:view>` (use the attribute version
20
41
`<div ng-view>` instead), or
21
42
22
- 3 . if you **do use** custom element tags, then you must take these steps to make IE happy:
23
-
24
- <pre >
25
- <html xmlns:ng="http://angularjs.org">
26
- <head>
27
- <!--[if lte IE 8]>
28
- <script>
29
- document.createElement('ng-include');
30
- document.createElement('ng-pluralize');
31
- document.createElement('ng-view');
32
-
33
- // Optionally these for CSS
34
- document.createElement('ng:include');
35
- document.createElement('ng:pluralize');
36
- document.createElement('ng:view');
37
- </script>
38
- <![endif]-->
39
- </head>
40
- <body>
41
- ...
42
- </body>
43
- </html>
44
- </pre>
43
+ 4 . if you **do use** custom element tags, then you must take these steps to make IE happy:
44
+ <pre>
45
+ <!doctype html >
46
+ <html xmlns:ng="http://angularjs.org" id="ng-app" ng-app="optionalModuleName ">
47
+ <head>
48
+ <!--[if lte IE 8]>
49
+ <script>
50
+ document.createElement('ng-include');
51
+ document.createElement('ng-pluralize');
52
+ document.createElement('ng-view');
53
+
54
+ // Optionally these for CSS
55
+ document.createElement('ng:include');
56
+ document.createElement('ng:pluralize');
57
+ document.createElement('ng:view');
58
+ </script>
59
+ <![endif]-->
60
+ </head>
61
+ <body>
62
+ ...
63
+ </body>
64
+ </html>
65
+ </pre>
45
66
46
67
The **important** parts are:
47
68
0 commit comments