Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit f24cf4b

Browse files
bcamp1973vojtajina
authored andcommitted
docs(guide): updates for legacy IE7 support
- note re: id="ng-app" to bootstrap/IE partials - added doctype/xmlns to markup - add cond comment re: json2/3 to markup
1 parent a752e57 commit f24cf4b

File tree

2 files changed

+50
-25
lines changed

2 files changed

+50
-25
lines changed

docs/content/guide/bootstrap.ngdoc

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ initialization.
3838

3939
<html ng-app>
4040

41+
* If IE7 support is required add `id="ng-app"`
42+
43+
<html ng-app id="ng-app">
44+
4145
* If you choose to use the old style directive syntax `ng:` then include xml-namespace in `html`
4246
to make IE happy. (This is here for historical reasons, and we no longer recommend use of
4347
`ng:`.)

docs/content/guide/ie.ngdoc

+46-25
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,54 @@ To make your Angular application work on IE please make sure that:
1515
1. You polyfill JSON.stringify if necessary (IE7 will need this). You can use
1616
[JSON2](https://github.com/douglascrockford/JSON-js) or
1717
[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
2041
`<div ng-view>` instead), or
2142

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>
4566

4667
The **important** parts are:
4768

0 commit comments

Comments
 (0)