Skip to content

Commit 8631f37

Browse files
committed
Update to Angular v9
1 parent a8aadca commit 8631f37

38 files changed

+283
-173
lines changed

APM-Final/.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ indent_size = 2
88
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

11+
[*.ts]
12+
quote_type = single
13+
1114
[*.md]
1215
max_line_length = off
1316
trim_trailing_whitespace = false

APM-Final/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
/node_modules
1212

1313
# profiling files
14-
chrome-profiler-events.json
15-
speed-measure-plugin.json
14+
chrome-profiler-events*.json
15+
speed-measure-plugin*.json
1616

1717
# IDEs and editors
1818
/.idea

APM-Final/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# APM
22

3-
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.1.2.
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.1.
44

55
## Development server
66

APM-Final/angular.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"main": "src/main.ts",
1919
"polyfills": "src/polyfills.ts",
2020
"tsConfig": "tsconfig.app.json",
21-
"aot": false,
21+
"aot": true,
2222
"assets": [
2323
"src/favicon.ico",
2424
"src/assets",
@@ -42,7 +42,6 @@
4242
"sourceMap": false,
4343
"extractCss": true,
4444
"namedChunks": false,
45-
"aot": true,
4645
"extractLicenses": true,
4746
"vendorChunk": false,
4847
"buildOptimizer": true,
@@ -51,6 +50,11 @@
5150
"type": "initial",
5251
"maximumWarning": "2mb",
5352
"maximumError": "5mb"
53+
},
54+
{
55+
"type": "anyComponentStyle",
56+
"maximumWarning": "6kb",
57+
"maximumError": "10kb"
5458
}
5559
]
5660
}
@@ -116,6 +120,7 @@
116120
}
117121
}
118122
}
119-
}},
123+
}
124+
},
120125
"defaultProject": "APM"
121126
}

APM-Final/e2e/protractor.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ exports.config = {
1313
'./src/**/*.e2e-spec.ts'
1414
],
1515
capabilities: {
16-
'browserName': 'chrome'
16+
browserName: 'chrome'
1717
},
1818
directConnect: true,
1919
baseUrl: 'http://localhost:4200/',

APM-Final/e2e/src/app.e2e-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('workspace-project App', () => {
1010

1111
it('should display welcome message', () => {
1212
page.navigateTo();
13-
expect(page.getTitleText()).toEqual('Welcome to APM!');
13+
expect(page.getTitleText()).toEqual('Welcome to Angular: Getting Started!!');
1414
});
1515

1616
afterEach(async () => {

APM-Final/e2e/src/app.po.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { browser, by, element } from 'protractor';
22

33
export class AppPage {
4-
navigateTo() {
5-
return browser.get(browser.baseUrl) as Promise<any>;
4+
navigateTo(): Promise<unknown> {
5+
return browser.get(browser.baseUrl) as Promise<unknown>;
66
}
77

8-
getTitleText() {
8+
getTitleText(): Promise<string> {
99
return element(by.css('pm-root h1')).getText() as Promise<string>;
1010
}
1111
}

APM-Final/package.json

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,39 @@
1111
},
1212
"private": true,
1313
"dependencies": {
14-
"@angular/animations": "~8.1.2",
15-
"@angular/common": "~8.1.2",
16-
"@angular/compiler": "~8.1.2",
17-
"@angular/core": "~8.1.2",
18-
"@angular/forms": "~8.1.2",
19-
"@angular/platform-browser": "~8.1.2",
20-
"@angular/platform-browser-dynamic": "~8.1.2",
21-
"@angular/router": "~8.1.2",
22-
"bootstrap": "^4.3.1",
14+
"@angular/animations": "~9.1.1",
15+
"@angular/common": "~9.1.1",
16+
"@angular/compiler": "~9.1.1",
17+
"@angular/core": "~9.1.1",
18+
"@angular/forms": "~9.1.1",
19+
"@angular/platform-browser": "~9.1.1",
20+
"@angular/platform-browser-dynamic": "~9.1.1",
21+
"@angular/router": "~9.1.1",
22+
"bootstrap": "^4.4.1",
2323
"font-awesome": "^4.7.0",
24-
"rxjs": "~6.4.0",
25-
"tslib": "^1.9.0",
26-
"zone.js": "~0.9.1"
24+
"rxjs": "~6.5.4",
25+
"tslib": "^1.10.0",
26+
"zone.js": "~0.10.2"
2727
},
2828
"devDependencies": {
29-
"@angular-devkit/build-angular": "~0.801.2",
30-
"@angular/cli": "~8.1.2",
31-
"@angular/compiler-cli": "~8.1.2",
32-
"@angular/language-service": "~8.1.2",
33-
"@types/node": "~8.9.4",
34-
"@types/jasmine": "~3.3.8",
29+
"@angular-devkit/build-angular": "~0.901.1",
30+
"@angular/cli": "~9.1.1",
31+
"@angular/compiler-cli": "~9.1.1",
32+
"@angular/language-service": "~9.1.1",
33+
"@types/node": "^12.11.1",
34+
"@types/jasmine": "~3.5.0",
3535
"@types/jasminewd2": "~2.0.3",
36-
"codelyzer": "^5.0.0",
37-
"jasmine-core": "~3.4.0",
36+
"codelyzer": "^5.1.2",
37+
"jasmine-core": "~3.5.0",
3838
"jasmine-spec-reporter": "~4.2.1",
39-
"karma": "~4.1.0",
40-
"karma-chrome-launcher": "~2.2.0",
41-
"karma-coverage-istanbul-reporter": "~2.0.1",
42-
"karma-jasmine": "~2.0.1",
43-
"karma-jasmine-html-reporter": "^1.4.0",
44-
"protractor": "~5.4.0",
45-
"ts-node": "~7.0.0",
46-
"tslint": "~5.15.0",
47-
"typescript": "~3.4.3"
39+
"karma": "~4.4.1",
40+
"karma-chrome-launcher": "~3.1.0",
41+
"karma-coverage-istanbul-reporter": "~2.1.0",
42+
"karma-jasmine": "~3.0.1",
43+
"karma-jasmine-html-reporter": "^1.4.2",
44+
"protractor": "~5.4.3",
45+
"ts-node": "~8.3.0",
46+
"tslint": "~6.1.0",
47+
"typescript": "~3.8.3"
4848
}
4949
}

APM-Final/src/app/app.component.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ describe('AppComponent', () => {
1212

1313
it('should create the app', () => {
1414
const fixture = TestBed.createComponent(AppComponent);
15-
const app = fixture.debugElement.componentInstance;
15+
const app = fixture.componentInstance;
1616
expect(app).toBeTruthy();
1717
});
1818

1919
it(`should have as title 'Angular: Getting Started'`, () => {
2020
const fixture = TestBed.createComponent(AppComponent);
21-
const app = fixture.debugElement.componentInstance;
21+
const app = fixture.componentInstance;
2222
expect(app.title).toEqual('Angular: Getting Started');
2323
});
2424

25-
it('should render title in a h1 tag', () => {
25+
it('should render title', () => {
2626
const fixture = TestBed.createComponent(AppComponent);
2727
fixture.detectChanges();
28-
const compiled = fixture.debugElement.nativeElement;
29-
expect(compiled.querySelector('h1').textContent).toContain('Welcome to Angular: Getting Started!');
28+
const compiled = fixture.nativeElement;
29+
expect(compiled.querySelector('h1').textContent).toContain('Welcome to Angular: Getting Started!!');
3030
});
3131
});

APM-Final/src/app/products/product-detail.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ describe('ProductDetailComponent', () => {
88

99
beforeEach(async(() => {
1010
TestBed.configureTestingModule({
11-
declarations: [ ProductDetailComponent ]
11+
declarations: [ProductDetailComponent]
1212
})
13-
.compileComponents();
13+
.compileComponents();
1414
}));
1515

1616
beforeEach(() => {
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import { TestBed, async, inject } from '@angular/core/testing';
1+
import { TestBed } from '@angular/core/testing';
22

33
import { ProductDetailGuard } from './product-detail.guard';
44

55
describe('ProductDetailGuard', () => {
6+
let guard: ProductDetailGuard;
7+
68
beforeEach(() => {
7-
TestBed.configureTestingModule({
8-
providers: [ProductDetailGuard]
9-
});
9+
TestBed.configureTestingModule({});
10+
guard = TestBed.inject(ProductDetailGuard);
1011
});
1112

12-
it('should ...', inject([ProductDetailGuard], (guard: ProductDetailGuard) => {
13+
it('should be created', () => {
1314
expect(guard).toBeTruthy();
14-
}));
15+
});
1516
});

APM-Final/src/app/products/product-detail.guard.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,4 @@ export class ProductDetailGuard implements CanActivate {
2222
}
2323
return true;
2424
}
25-
2625
}

APM-Final/src/app/products/product-list.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ <h4>Filtered by: {{listFilter}}</h4>
4848
{{ product.productName }}
4949
</a>
5050
</td>
51-
<td>{{ product.productCode | lowercase | convertToSpaces: '-' }}</td>
51+
<td>{{ product.productCode | lowercase | convertToSpaces:'-' }}</td>
5252
<td>{{ product.releaseDate }}</td>
53-
<td>{{ product.price | currency:'USD':'symbol':'1.2-2'}}</td>
53+
<td>{{ product.price | currency:'USD':'symbol':'1.2-2' }}</td>
5454
<td>
5555
<pm-star [rating]='product.starRating'
5656
(ratingClicked)='onRatingClicked($event)'>

APM-Final/src/app/products/product-list.component.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ export class ProductListComponent implements OnInit {
2626
filteredProducts: IProduct[] = [];
2727
products: IProduct[] = [];
2828

29-
constructor(private productService: ProductService) {
30-
31-
}
29+
constructor(private productService: ProductService) { }
3230

3331
onRatingClicked(message: string): void {
3432
this.pageTitle = 'Product List: ' + message;
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
import { NgModule } from '@angular/core';
2-
import { RouterModule } from '@angular/router';
3-
42
import { ProductListComponent } from './product-list.component';
53
import { ProductDetailComponent } from './product-detail.component';
64
import { ConvertToSpacesPipe } from '../shared/convert-to-spaces.pipe';
5+
import { RouterModule } from '@angular/router';
76
import { ProductDetailGuard } from './product-detail.guard';
87
import { SharedModule } from '../shared/shared.module';
98

109
@NgModule({
10+
declarations: [
11+
ProductListComponent,
12+
ProductDetailComponent,
13+
ConvertToSpacesPipe,
14+
],
1115
imports: [
1216
RouterModule.forChild([
1317
{ path: 'products', component: ProductListComponent },
@@ -18,11 +22,6 @@ import { SharedModule } from '../shared/shared.module';
1822
}
1923
]),
2024
SharedModule
21-
],
22-
declarations: [
23-
ProductListComponent,
24-
ProductDetailComponent,
25-
ConvertToSpacesPipe
2625
]
2726
})
2827
export class ProductModule { }

APM-Final/src/app/products/product.service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,4 @@ export class ProductService {
4646
console.error(errorMessage);
4747
return throwError(errorMessage);
4848
}
49-
5049
}

APM-Final/src/app/shared/shared.module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import { StarComponent } from './star.component';
44
import { FormsModule } from '@angular/forms';
55

66
@NgModule({
7-
imports: [
8-
CommonModule
9-
],
107
declarations: [
118
StarComponent
129
],
10+
imports: [
11+
CommonModule
12+
],
1313
exports: [
1414
StarComponent,
1515
CommonModule,

APM-Final/src/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<meta charset="utf-8">
55
<title>APM</title>
66
<base href="/">
7-
87
<meta name="viewport" content="width=device-width, initial-scale=1">
98
<link rel="icon" type="image/x-icon" href="favicon.ico">
109
</head>

APM-Final/src/polyfills.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* will put import in the top of bundle, so user need to create a separate file
3636
* in this directory (for example: zone-flags.ts), and put the following flags
3737
* into that file, and then add the following code before importing zone.js.
38-
* import './zone-flags.ts';
38+
* import './zone-flags';
3939
*
4040
* The flags allowed in zone-flags.ts are listed here.
4141
*

APM-Final/src/test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ import {
77
platformBrowserDynamicTesting
88
} from '@angular/platform-browser-dynamic/testing';
99

10-
declare const require: any;
10+
declare const require: {
11+
context(path: string, deep?: boolean, filter?: RegExp): {
12+
keys(): string[];
13+
<T>(id: string): T;
14+
};
15+
};
1116

1217
// First, initialize the Angular testing environment.
1318
getTestBed().initTestEnvironment(

APM-Final/tsconfig.app.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"outDir": "./out-tsc/app",
55
"types": []
66
},
7-
"include": [
8-
"src/**/*.ts"
7+
"files": [
8+
"src/main.ts",
9+
"src/polyfills.ts"
910
],
10-
"exclude": [
11-
"src/test.ts",
12-
"src/**/*.spec.ts"
11+
"include": [
12+
"src/**/*.d.ts"
1313
]
1414
}

APM-Final/tsconfig.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,11 @@
66
"sourceMap": true,
77
"declaration": false,
88
"downlevelIteration": true,
9-
"emitDecoratorMetadata": true, // Needed for Stackblitz
109
"experimentalDecorators": true,
1110
"module": "esnext",
1211
"moduleResolution": "node",
1312
"importHelpers": true,
1413
"target": "es2015",
15-
"typeRoots": [
16-
"node_modules/@types"
17-
],
1814
"lib": [
1915
"es2018",
2016
"dom"

0 commit comments

Comments
 (0)