Skip to content
This repository was archived by the owner on Oct 14, 2019. It is now read-only.

Commit e473f96

Browse files
committed
upgraded to Angular 2.4 and latest CLI
1 parent 1c54331 commit e473f96

File tree

8 files changed

+123
-70
lines changed

8 files changed

+123
-70
lines changed

angular-cli.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"styles.css"
2222
],
2323
"scripts": [],
24-
"environments": {
24+
"environmentSource": {
2525
"source": "environments/environment.ts",
2626
"dev": "environments/environment.ts",
2727
"prod": "environments/environment.prod.ts"

e2e/tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
"declaration": false,
55
"emitDecoratorMetadata": true,
66
"experimentalDecorators": true,
7+
"lib": [
8+
"es2016"
9+
],
710
"module": "commonjs",
811
"moduleResolution": "node",
912
"outDir": "../dist/out-tsc-e2e",
1013
"sourceMap": true,
11-
"target": "es5",
14+
"target": "es6",
1215
"typeRoots": [
1316
"../node_modules/@types"
1417
]

package.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,48 +8,48 @@
88
"start": "ng serve",
99
"lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-check && tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check",
1010
"test": "ng test",
11-
"pree2e": "webdriver-manager update --standalone false --gecko false",
12-
"e2e": "protractor",
11+
"lint": "ng lint",
12+
"e2e": "ng e2e",
1313
"populate-db": "./node_modules/.bin/ts-node ./populate-db.ts",
1414
"batch-server": "./node_modules/.bin/ts-node ./batch-server.ts"
1515
},
1616
"private": true,
1717
"dependencies": {
18-
"@angular/common": "^2.3.1",
19-
"@angular/compiler": "^2.3.1",
20-
"@angular/core": "^2.3.1",
21-
"@angular/forms": "^2.3.1",
22-
"@angular/http": "^2.3.1",
23-
"@angular/platform-browser": "^2.3.1",
24-
"@angular/platform-browser-dynamic": "^2.3.1",
25-
"@angular/router": "^3.3.1",
18+
"@angular/common": "^2.4.0",
19+
"@angular/compiler": "^2.4.0",
20+
"@angular/core": "^2.4.0",
21+
"@angular/forms": "^2.4.0",
22+
"@angular/http": "^2.4.0",
23+
"@angular/platform-browser": "^2.4.0",
24+
"@angular/platform-browser-dynamic": "^2.4.0",
25+
"@angular/router": "^3.4.0",
2626
"@types/lodash": "^4.14.36",
2727
"@types/request": "0.0.30",
2828
"angularfire2": "^2.0.0-beta.4",
2929
"core-js": "^2.4.1",
3030
"firebase": "^3.6.6",
3131
"firebase-queue": "^1.5.0",
3232
"lodash": "^4.15.0",
33-
"rxjs": "^5.0.1",
34-
"ts-helpers": "^1.1.1",
35-
"zone.js": "^0.7.2"
33+
"rxjs": "^5.1.0",
34+
"zone.js": "^0.7.6"
3635
},
3736
"devDependencies": {
38-
"@angular/compiler-cli": "^2.3.1",
37+
"@angular/cli": "1.0.0-beta.32.3",
38+
"@angular/compiler-cli": "^2.4.0",
3939
"@types/jasmine": "2.5.38",
40-
"@types/node": "^6.0.42",
41-
"angular-cli": "1.0.0-beta.25.5",
42-
"codelyzer": "~2.0.0-beta.1",
43-
"jasmine-core": "2.5.2",
44-
"jasmine-spec-reporter": "2.5.0",
45-
"karma": "1.2.0",
46-
"karma-chrome-launcher": "^2.0.0",
47-
"karma-cli": "^1.0.1",
48-
"karma-jasmine": "^1.0.2",
49-
"karma-remap-istanbul": "^0.2.1",
50-
"protractor": "~4.0.13",
51-
"ts-node": "1.2.1",
52-
"tslint": "^4.3.0",
53-
"typescript": "~2.0.3"
40+
"@types/node": "~6.0.60",
41+
"codelyzer": "~2.0.0-beta.4",
42+
"jasmine-core": "~2.5.2",
43+
"jasmine-spec-reporter": "~3.2.0",
44+
"karma": "~1.4.1",
45+
"karma-chrome-launcher": "~2.0.0",
46+
"karma-cli": "~1.0.1",
47+
"karma-jasmine": "~1.1.0",
48+
"karma-jasmine-html-reporter": "^0.2.2",
49+
"karma-coverage-istanbul-reporter": "^0.2.0",
50+
"protractor": "~5.1.0",
51+
"ts-node": "~2.0.0",
52+
"tslint": "~4.4.2",
53+
"typescript": "~2.0.0"
5454
}
5555
}

src/environments/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// The file contents for the current environment will overwrite these during build.
22
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
33
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
4-
// The list of which env maps to which file can be found in `angular-cli.json`.
4+
// The list of which env maps to which file can be found in `.angular-cli.json`.
55

66
export const environment = {
77
production: false

src/polyfills.ts

Lines changed: 66 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,68 @@
1-
// This file includes polyfills needed by Angular and is loaded before
2-
// the app. You can add your own extra polyfills to this file.
3-
import 'core-js/es6/symbol';
4-
import 'core-js/es6/object';
5-
import 'core-js/es6/function';
6-
import 'core-js/es6/parse-int';
7-
import 'core-js/es6/parse-float';
8-
import 'core-js/es6/number';
9-
import 'core-js/es6/math';
10-
import 'core-js/es6/string';
11-
import 'core-js/es6/date';
12-
import 'core-js/es6/array';
13-
import 'core-js/es6/regexp';
14-
import 'core-js/es6/map';
15-
import 'core-js/es6/set';
16-
import 'core-js/es6/reflect';
1+
/**
2+
* This file includes polyfills needed by Angular and is loaded before the app.
3+
* You can add your own extra polyfills to this file.
4+
*
5+
* This file is divided into 2 sections:
6+
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7+
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8+
* file.
9+
*
10+
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11+
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12+
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13+
*
14+
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
15+
*/
16+
17+
/***************************************************************************************************
18+
* BROWSER POLYFILLS
19+
*/
20+
21+
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
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/set';
35+
36+
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
37+
// import 'classlist.js'; // Run `npm install --save classlist.js`.
1738

39+
/** IE10 and IE11 requires the following to support `@angular/animation`. */
40+
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
41+
42+
43+
/** Evergreen browsers require these. **/
44+
import 'core-js/es6/reflect';
1845
import 'core-js/es7/reflect';
19-
import 'zone.js/dist/zone';
46+
47+
48+
/** ALL Firefox browsers require the following to support `@angular/animation`. **/
49+
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
50+
51+
52+
53+
/***************************************************************************************************
54+
* Zone JS is required by Angular itself.
55+
*/
56+
import 'zone.js/dist/zone'; // Included with Angular CLI.
57+
58+
59+
60+
/***************************************************************************************************
61+
* APPLICATION IMPORTS
62+
*/
63+
64+
/**
65+
* Date, currency, decimal and percent pipes.
66+
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
67+
*/
68+
// import 'intl'; // Run `npm install --save intl`.

src/test.ts

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
import './polyfills.ts';
1+
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
22

33
import 'zone.js/dist/long-stack-trace-zone';
44
import 'zone.js/dist/proxy.js';
55
import 'zone.js/dist/sync-test';
66
import 'zone.js/dist/jasmine-patch';
77
import 'zone.js/dist/async-test';
88
import 'zone.js/dist/fake-async-test';
9+
import { getTestBed } from '@angular/core/testing';
10+
import {
11+
BrowserDynamicTestingModule,
12+
platformBrowserDynamicTesting
13+
} from '@angular/platform-browser-dynamic/testing';
914

1015
// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
1116
declare var __karma__: any;
@@ -14,21 +19,14 @@ declare var require: any;
1419
// Prevent Karma from running prematurely.
1520
__karma__.loaded = function () {};
1621

17-
18-
Promise.all([
19-
System.import('@angular/core/testing'),
20-
System.import('@angular/platform-browser-dynamic/testing')
21-
])
22-
// First, initialize the Angular testing environment.
23-
.then(([testing, testingBrowser]) => {
24-
testing.getTestBed().initTestEnvironment(
25-
testingBrowser.BrowserDynamicTestingModule,
26-
testingBrowser.platformBrowserDynamicTesting()
27-
);
28-
})
29-
// Then we find all the tests.
30-
.then(() => require.context('./', true, /\.spec\.ts/))
31-
// And load the modules.
32-
.then(context => context.keys().map(context))
33-
// Finally, start Karma to run the tests.
34-
.then(__karma__.start, __karma__.error);
22+
// First, initialize the Angular testing environment.
23+
getTestBed().initTestEnvironment(
24+
BrowserDynamicTestingModule,
25+
platformBrowserDynamicTesting()
26+
);
27+
// Then we find all the tests.
28+
const context = require.context('./', true, /\.spec\.ts$/);
29+
// And load the modules.
30+
context.keys().map(context);
31+
// Finally, start Karma to run the tests.
32+
__karma__.start();

src/tsconfig.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
"declaration": false,
55
"emitDecoratorMetadata": true,
66
"experimentalDecorators": true,
7-
"lib": ["es6", "dom"],
7+
"lib": [
8+
"es2016",
9+
"dom"
10+
],
811
"mapRoot": "./",
9-
"module": "es6",
12+
"module": "es2015",
1013
"moduleResolution": "node",
1114
"outDir": "../dist/out-tsc",
1215
"sourceMap": true,

tslint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"no-empty": false,
4747
"no-empty-interface": true,
4848
"no-eval": true,
49-
"no-inferrable-types": true,
49+
"no-inferrable-types": [true, "ignore-params"],
5050
"no-shadowed-variable": true,
5151
"no-string-literal": false,
5252
"no-string-throw": true,

0 commit comments

Comments
 (0)