Skip to content
This repository was archived by the owner on Nov 23, 2021. It is now read-only.

Commit 6794264

Browse files
committed
Enabled polyfills, added X-UA-Compatible meta tag
1 parent cd2d869 commit 6794264

File tree

5 files changed

+49
-27
lines changed

5 files changed

+49
-27
lines changed

.travis.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ before_install:
77
# starting a GUI to run tests, per https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI
88
- export DISPLAY=:99.0
99
- sh -e /etc/init.d/xvfb start
10-
before_script:
10+
install:
1111
- npm install -g @angular/cli
1212
script:
13-
- npm run-script build:dist
14-
- npm run-script test:coverage
13+
- npm run-script build4prod
14+
- npm run-script test4ci
1515
after_success:
1616
- bash <(curl -s https://codecov.io/bash)

README.adoc

+22-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ and start the application
7272

7373
----
7474
ng serve
75+
7576
----
7677

7778
== How we created the application
@@ -117,13 +118,24 @@ plugins: [
117118
...
118119
----
119120

120-
Enable (uncomment) some polyfills needed by the http://phantomjs.org/[PhantomJS] (`polyfills.ts`):
121+
Enable (uncomment) all polyfills required for IE9, IE10 and IE11. Some of them are also needed by the http://phantomjs.org/[PhantomJS] (`polyfills.ts`):
121122

122123
[source, javascript]
123124
----
125+
import 'core-js/es6/symbol';
124126
import 'core-js/es6/object';
127+
import 'core-js/es6/function';
128+
import 'core-js/es6/parse-int';
129+
import 'core-js/es6/parse-float';
130+
import 'core-js/es6/number';
131+
import 'core-js/es6/math';
125132
import 'core-js/es6/string';
133+
import 'core-js/es6/date';
126134
import 'core-js/es6/array';
135+
import 'core-js/es6/regexp';
136+
import 'core-js/es6/map';
137+
import 'core-js/es6/weak-map';
138+
import 'core-js/es6/set';
127139
----
128140

129141
Typically the following command should be executed in the Continuous Integration environment:
@@ -144,3 +156,12 @@ yarn add bootstrap@next @ng-bootstrap/ng-bootstrap
144156
----
145157

146158
Follow the https://ng-bootstrap.github.io/#/getting-started[ng-bootstrap installation instructions].
159+
160+
==== Make IE users happy
161+
162+
Specify the `x-ua-compatible` meta tag with `edge` mode. This will force Internet Explorer to render the webpage in the highest available mode (`index.html`):
163+
164+
[source, html]
165+
----
166+
<meta http-equiv="x-ua-compatible" content="ie=edge">
167+
----

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "oasp4js-ng-project-seed",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"license": "MIT",
55
"scripts": {
66
"ng": "ng",
@@ -9,8 +9,8 @@
99
"test": "ng test",
1010
"lint": "ng lint",
1111
"e2e": "ng e2e",
12-
"build:dist": "ng build --prod",
13-
"test:coverage": "ng test --single-run --code-coverage --browsers=PhantomJS"
12+
"build4prod": "ng build --prod --aot",
13+
"test4ci": "ng test --single-run --code-coverage --browsers=PhantomJS"
1414
},
1515
"private": true,
1616
"dependencies": {

src/index.html

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<!doctype html>
22
<html>
33
<head>
4-
<meta charset="utf-8">
5-
<title>oasp4js ng project seed</title>
6-
<base href="/">
4+
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
5+
<meta charset="utf-8">
6+
<title>oasp4js ng project seed</title>
7+
<base href="/">
78

8-
<meta name="viewport" content="width=device-width, initial-scale=1">
9-
<link rel="icon" type="image/x-icon" href="favicon.ico">
9+
<meta name="viewport" content="width=device-width, initial-scale=1">
10+
<link rel="icon" type="image/x-icon" href="favicon.ico">
1011
</head>
1112
<body>
12-
<app-root>Loading...</app-root>
13+
<app-root>Loading...</app-root>
1314
</body>
1415
</html>

src/polyfills.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@
1919
*/
2020

2121
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
22-
// import 'core-js/es6/symbol';
23-
import 'core-js/es6/object'; // required by PhantomJS
24-
// import 'core-js/es6/function';
25-
// import 'core-js/es6/parse-int';
26-
// import 'core-js/es6/parse-float';
27-
// import 'core-js/es6/number';
28-
// import 'core-js/es6/math';
29-
import 'core-js/es6/string'; // required by PhantomJS
30-
// import 'core-js/es6/date';
31-
import 'core-js/es6/array'; // required by PhantomJS
32-
// import 'core-js/es6/regexp';
33-
// import 'core-js/es6/map';
34-
// import 'core-js/es6/weak-map';
35-
// import 'core-js/es6/set';
22+
import 'core-js/es6/symbol';
23+
import 'core-js/es6/object';
24+
import 'core-js/es6/function';
25+
import 'core-js/es6/parse-int';
26+
import 'core-js/es6/parse-float';
27+
import 'core-js/es6/number';
28+
import 'core-js/es6/math';
29+
import 'core-js/es6/string';
30+
import 'core-js/es6/date';
31+
import 'core-js/es6/array';
32+
import 'core-js/es6/regexp';
33+
import 'core-js/es6/map';
34+
import 'core-js/es6/weak-map';
35+
import 'core-js/es6/set';
3636

3737
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
3838
// import 'classlist.js'; // Run `npm install --save classlist.js`.

0 commit comments

Comments
 (0)