Skip to content

Commit e61363f

Browse files
committed
Upgrade to Angular 14
1 parent 70987db commit e61363f

File tree

8 files changed

+7628
-7844
lines changed

8 files changed

+7628
-7844
lines changed

angular.json

-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@
106106
}
107107
}
108108
},
109-
"defaultProject": "angular-testing-course",
110109
"schematics": {
111110
"@schematics/angular:component": {
112111
"style": "scss"

package-lock.json

+7,562-7,780
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+18-17
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,20 @@
1818
},
1919
"private": true,
2020
"dependencies": {
21-
"@angular/animations": "13.0.3",
22-
"@angular/cdk": "^13.0.3",
23-
"@angular/common": "13.0.3",
24-
"@angular/compiler": "13.0.3",
25-
"@angular/core": "13.0.3",
26-
"@angular/forms": "13.0.3",
27-
"@angular/material": "^13.0.3",
28-
"@angular/material-moment-adapter": "13.0.3",
29-
"@angular/platform-browser": "13.0.3",
30-
"@angular/platform-browser-dynamic": "13.0.3",
31-
"@angular/router": "13.0.3",
21+
"@angular/animations": "14.0.1",
22+
"@angular/cdk": "^14.0.1",
23+
"@angular/common": "14.0.1",
24+
"@angular/compiler": "14.0.1",
25+
"@angular/core": "14.0.1",
26+
"@angular/forms": "14.0.1",
27+
"@angular/material": "^14.0.1",
28+
"@angular/material-moment-adapter": "14.0.1",
29+
"@angular/platform-browser": "14.0.1",
30+
"@angular/platform-browser-dynamic": "14.0.1",
31+
"@angular/router": "14.0.1",
3232
"body-parser": "^1.18.3",
3333
"core-js": "^3.19.0",
34+
"cors": "^2.8.5",
3435
"cypress": "^9.1.1",
3536
"express": "^4.16.2",
3637
"http-server": "^14.0.0",
@@ -41,16 +42,16 @@
4142
"zone.js": "~0.11.4"
4243
},
4344
"devDependencies": {
44-
"@angular-devkit/build-angular": "^13.0.4",
45-
"@angular/cli": "^13.0.4",
46-
"@angular/compiler-cli": "13.0.3",
47-
"@angular/language-service": "13.0.3",
45+
"@angular-devkit/build-angular": "^14.0.1",
46+
"@angular/cli": "^14.0.1",
47+
"@angular/compiler-cli": "14.0.1",
48+
"@angular/language-service": "14.0.1",
4849
"@cypress/webpack-preprocessor": "^4.0.3",
4950
"@types/express": "^4.0.39",
5051
"@types/jasmine": "~3.6.0",
5152
"@types/jasminewd2": "~2.0.2",
5253
"@types/node": "^12.11.1",
53-
"codelyzer": "^6.0.0",
54+
"codelyzer": "^0.0.28",
5455
"jasmine-core": "~3.6.0",
5556
"jasmine-spec-reporter": "~5.0.0",
5657
"karma": "~6.3.2",
@@ -63,6 +64,6 @@
6364
"start-server-and-test": "^1.9.1",
6465
"ts-node": "~3.2.0",
6566
"tslint": "~6.1.0",
66-
"typescript": "4.4.4"
67+
"typescript": "4.7.3"
6768
}
6869
}

server/save-course.route.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {findCourseById} from './db-data';
55

66
export function saveCourse(req: Request, res: Response) {
77

8-
const id = req.params["id"],
8+
const id = req.params["id"] as any,
99
changes = req.body;
1010

1111
console.log("Saving course", id, JSON.stringify(changes));

server/search-lessons.route.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {setTimeout} from "timers";
99

1010
export function searchLessons(req: Request, res: Response) {
1111

12-
const queryParams = req.query;
12+
const queryParams = req.query as any;
1313

1414
const courseId = queryParams.courseId,
1515
filter = queryParams.filter || '',
@@ -36,4 +36,4 @@ export function searchLessons(req: Request, res: Response) {
3636
},1000);
3737

3838

39-
}
39+
}

server/server.ts

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ const bodyParser = require('body-parser');
1010

1111
const app: Application = express();
1212

13+
const cors = require('cors');
14+
15+
app.use(cors({origin: true}));
16+
1317
app.use(bodyParser.json());
1418

1519

src/app/courses/courses.module.ts

+40-42
Original file line numberDiff line numberDiff line change
@@ -30,48 +30,46 @@ import {CoursesService} from './services/courses.service';
3030
import {CourseResolver} from './services/course.resolver';
3131

3232
@NgModule({
33-
declarations: [
34-
HomeComponent,
35-
AboutComponent,
36-
CourseComponent,
37-
CoursesCardListComponent,
38-
CourseDialogComponent
39-
],
40-
imports: [
41-
CommonModule,
42-
MatMenuModule,
43-
MatButtonModule,
44-
MatToolbarModule,
45-
MatIconModule,
46-
MatCardModule,
47-
MatTabsModule,
48-
MatSidenavModule,
49-
MatListModule,
50-
MatInputModule,
51-
MatTableModule,
52-
MatPaginatorModule,
53-
MatSortModule,
54-
MatProgressSpinnerModule,
55-
MatDialogModule,
56-
MatSelectModule,
57-
MatDatepickerModule,
58-
MatMomentDateModule,
59-
ReactiveFormsModule,
60-
AppRoutingModule
61-
],
62-
exports: [
63-
HomeComponent,
64-
AboutComponent,
65-
CourseComponent,
66-
CoursesCardListComponent,
67-
CourseDialogComponent
68-
],
69-
providers: [
70-
CoursesService,
71-
CourseResolver
72-
],
73-
entryComponents: [CourseDialogComponent]
74-
33+
declarations: [
34+
HomeComponent,
35+
AboutComponent,
36+
CourseComponent,
37+
CoursesCardListComponent,
38+
CourseDialogComponent
39+
],
40+
imports: [
41+
CommonModule,
42+
MatMenuModule,
43+
MatButtonModule,
44+
MatToolbarModule,
45+
MatIconModule,
46+
MatCardModule,
47+
MatTabsModule,
48+
MatSidenavModule,
49+
MatListModule,
50+
MatInputModule,
51+
MatTableModule,
52+
MatPaginatorModule,
53+
MatSortModule,
54+
MatProgressSpinnerModule,
55+
MatDialogModule,
56+
MatSelectModule,
57+
MatDatepickerModule,
58+
MatMomentDateModule,
59+
ReactiveFormsModule,
60+
AppRoutingModule
61+
],
62+
exports: [
63+
HomeComponent,
64+
AboutComponent,
65+
CourseComponent,
66+
CoursesCardListComponent,
67+
CourseDialogComponent
68+
],
69+
providers: [
70+
CoursesService,
71+
CourseResolver
72+
]
7573
})export class CoursesModule {
7674

7775

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"declaration": false,
88
"moduleResolution": "node",
99
"experimentalDecorators": true,
10-
"target": "es2015",
10+
"target": "es2020",
1111
"typeRoots": [
1212
"node_modules/@types"
1313
],

0 commit comments

Comments
 (0)