Skip to content

Commit 3fddc22

Browse files
committed
Update to Angular 17
1 parent 4515d2a commit 3fddc22

20 files changed

+98
-271
lines changed

dashboard-angular-app/.browserslistrc

-16
This file was deleted.

dashboard-angular-app/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DashboardAngularApp
22

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

55
## Development server
66

dashboard-angular-app/angular.json

+18-25
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
"prefix": "app",
1212
"architect": {
1313
"build": {
14-
"builder": "@angular-devkit/build-angular:browser",
14+
"builder": "@angular-devkit/build-angular:application",
1515
"options": {
1616
"outputPath": "dist/dashboard-angular-app",
1717
"index": "src/index.html",
18-
"main": "src/main.ts",
19-
"polyfills": "src/polyfills.ts",
18+
"browser": "src/main.ts",
19+
"polyfills": [
20+
"zone.js"
21+
],
2022
"tsConfig": "tsconfig.app.json",
2123
"assets": [
2224
"src/favicon.ico",
@@ -32,30 +34,21 @@
3234
"budgets": [
3335
{
3436
"type": "initial",
35-
"maximumWarning": "2mb",
36-
"maximumError": "5mb"
37+
"maximumWarning": "500kb",
38+
"maximumError": "1mb"
3739
},
3840
{
3941
"type": "anyComponentStyle",
40-
"maximumWarning": "6kb",
41-
"maximumError": "10kb"
42-
}
43-
],
44-
"fileReplacements": [
45-
{
46-
"replace": "src/environments/environment.ts",
47-
"with": "src/environments/environment.prod.ts"
42+
"maximumWarning": "2kb",
43+
"maximumError": "4kb"
4844
}
4945
],
5046
"outputHashing": "all"
5147
},
5248
"development": {
53-
"buildOptimizer": false,
5449
"optimization": false,
55-
"vendorChunk": true,
5650
"extractLicenses": false,
57-
"sourceMap": true,
58-
"namedChunks": true
51+
"sourceMap": true
5952
}
6053
},
6154
"defaultConfiguration": "production"
@@ -64,27 +57,28 @@
6457
"builder": "@angular-devkit/build-angular:dev-server",
6558
"configurations": {
6659
"production": {
67-
"browserTarget": "dashboard-angular-app:build:production"
60+
"buildTarget": "dashboard-angular-app:build:production"
6861
},
6962
"development": {
70-
"browserTarget": "dashboard-angular-app:build:development"
63+
"buildTarget": "dashboard-angular-app:build:development"
7164
}
7265
},
7366
"defaultConfiguration": "development"
7467
},
7568
"extract-i18n": {
7669
"builder": "@angular-devkit/build-angular:extract-i18n",
7770
"options": {
78-
"browserTarget": "dashboard-angular-app:build"
71+
"buildTarget": "dashboard-angular-app:build"
7972
}
8073
},
8174
"test": {
8275
"builder": "@angular-devkit/build-angular:karma",
8376
"options": {
84-
"main": "src/test.ts",
85-
"polyfills": "src/polyfills.ts",
77+
"polyfills": [
78+
"zone.js",
79+
"zone.js/testing"
80+
],
8681
"tsConfig": "tsconfig.spec.json",
87-
"karmaConfig": "karma.conf.js",
8882
"assets": [
8983
"src/favicon.ico",
9084
"src/assets"
@@ -97,6 +91,5 @@
9791
}
9892
}
9993
}
100-
},
101-
"defaultProject": "dashboard-angular-app"
94+
}
10295
}

dashboard-angular-app/karma.conf.js

-44
This file was deleted.

dashboard-angular-app/package.json

+27-28
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,35 @@
1010
},
1111
"private": true,
1212
"dependencies": {
13-
"@angular/animations": "~13.3.0",
14-
"@angular/common": "~13.3.0",
15-
"@angular/compiler": "~13.3.0",
16-
"@angular/core": "~13.3.0",
17-
"@angular/forms": "~13.3.0",
18-
"@angular/platform-browser": "~13.3.0",
19-
"@angular/platform-browser-dynamic": "~13.3.0",
20-
"@angular/router": "~13.3.0",
21-
"@devexpress/analytics-core": "22.2-stable",
22-
"devexpress-dashboard": "22.2-stable",
23-
"devexpress-dashboard-angular": "22.2-stable",
24-
"devextreme": "22.2-stable",
25-
"devextreme-angular": "22.2-stable",
26-
"devextreme-aspnet-data-nojquery": "^2.8.6",
27-
"rxjs": "~7.5.0",
13+
"@angular/animations": "^17.0.0",
14+
"@angular/common": "^17.0.0",
15+
"@angular/compiler": "^17.0.0",
16+
"@angular/core": "^17.0.0",
17+
"@angular/forms": "^17.0.0",
18+
"@angular/platform-browser": "^17.0.0",
19+
"@angular/platform-browser-dynamic": "^17.0.0",
20+
"@angular/router": "^17.0.0",
21+
"@devexpress/analytics-core": "^23.2.3",
22+
"devexpress-dashboard": "^23.2.3",
23+
"devexpress-dashboard-angular": "^23.2.3",
24+
"devextreme": "^23.2.3",
25+
"devextreme-angular": "^23.2.3",
26+
"devextreme-aspnet-data-nojquery": "^3.0.0",
27+
"rxjs": "~7.8.0",
2828
"tslib": "^2.3.0",
29-
"zone.js": "~0.11.4"
29+
"zone.js": "~0.14.2"
3030
},
3131
"devDependencies": {
32-
"@angular-devkit/build-angular": "~13.3.4",
33-
"@angular/cli": "~13.3.4",
34-
"@angular/compiler-cli": "~13.3.0",
35-
"@types/jasmine": "~3.10.0",
36-
"@types/node": "^12.11.1",
37-
"jasmine-core": "~4.0.0",
38-
"karma": "~6.3.0",
39-
"karma-chrome-launcher": "~3.1.0",
40-
"karma-coverage": "~2.1.0",
41-
"karma-jasmine": "~4.0.0",
42-
"karma-jasmine-html-reporter": "~1.7.0",
43-
"typescript": "~4.6.2"
32+
"@angular-devkit/build-angular": "^17.0.8",
33+
"@angular/cli": "^17.0.8",
34+
"@angular/compiler-cli": "^17.0.0",
35+
"@types/jasmine": "~5.1.0",
36+
"jasmine-core": "~5.1.0",
37+
"karma": "~6.4.0",
38+
"karma-chrome-launcher": "~3.2.0",
39+
"karma-coverage": "~2.2.0",
40+
"karma-jasmine": "~5.1.0",
41+
"karma-jasmine-html-reporter": "~2.1.0",
42+
"typescript": "~5.2.2"
4443
}
4544
}

dashboard-angular-app/src/app/app.component.spec.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import { AppComponent } from './app.component';
44
describe('AppComponent', () => {
55
beforeEach(async () => {
66
await TestBed.configureTestingModule({
7-
declarations: [
8-
AppComponent
9-
],
7+
imports: [AppComponent],
108
}).compileComponents();
119
});
1210

@@ -16,7 +14,7 @@ describe('AppComponent', () => {
1614
expect(app).toBeTruthy();
1715
});
1816

19-
it(`should have as title 'dashboard-angular-app'`, () => {
17+
it(`should have the 'dashboard-angular-app' title`, () => {
2018
const fixture = TestBed.createComponent(AppComponent);
2119
const app = fixture.componentInstance;
2220
expect(app.title).toEqual('dashboard-angular-app');
@@ -26,6 +24,6 @@ describe('AppComponent', () => {
2624
const fixture = TestBed.createComponent(AppComponent);
2725
fixture.detectChanges();
2826
const compiled = fixture.nativeElement as HTMLElement;
29-
expect(compiled.querySelector('.content span')?.textContent).toContain('dashboard-angular-app app is running!');
27+
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, dashboard-angular-app');
3028
});
3129
});

dashboard-angular-app/src/app/app.component.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
import { Component } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { RouterOutlet } from '@angular/router';
4+
import { DxDashboardControlModule } from 'devexpress-dashboard-angular';
5+
import { DevExtremeModule } from 'devextreme-angular';
26
import { createStore } from 'devextreme-aspnet-data-nojquery';
37
import CustomStore from 'devextreme/data/custom_store';
48
import DataSource from 'devextreme/data/data_source';
59

610
@Component({
711
selector: 'app-root',
12+
standalone: true,
13+
imports: [CommonModule, RouterOutlet, DxDashboardControlModule, DevExtremeModule],
814
templateUrl: './app.component.html',
9-
styleUrls: ['./app.component.css']
15+
styleUrl: './app.component.css'
1016
})
1117
export class AppComponent {
12-
serverUrl: string = "http://localhost:5000";
18+
serverUrl: string = "https://localhost:5001";
1319
/* To debug the server, change 'serverUrl' to https://localhost:44396 and run the server application in Visual Studio. */
1420
store: CustomStore;
1521
dataSource: DataSource;
@@ -26,4 +32,4 @@ export class AppComponent {
2632
pageSize: 20
2733
});
2834
}
29-
}
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { ApplicationConfig } from '@angular/core';
2+
import { provideRouter } from '@angular/router';
3+
4+
import { routes } from './app.routes';
5+
6+
export const appConfig: ApplicationConfig = {
7+
providers: [provideRouter(routes)]
8+
};

dashboard-angular-app/src/app/app.module.ts

-21
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { Routes } from '@angular/router';
2+
3+
export const routes: Routes = [];

dashboard-angular-app/src/environments/environment.prod.ts

-3
This file was deleted.

dashboard-angular-app/src/environments/environment.ts

-16
This file was deleted.

dashboard-angular-app/src/favicon.ico

13.8 KB
Binary file not shown.

dashboard-angular-app/src/main.ts

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
import { enableProdMode } from '@angular/core';
2-
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
1+
import { bootstrapApplication } from '@angular/platform-browser';
2+
import { appConfig } from './app/app.config';
3+
import { AppComponent } from './app/app.component';
34

4-
import { AppModule } from './app/app.module';
5-
import { environment } from './environments/environment';
6-
7-
if (environment.production) {
8-
enableProdMode();
9-
}
10-
11-
platformBrowserDynamic().bootstrapModule(AppModule)
12-
.catch(err => console.error(err));
5+
bootstrapApplication(AppComponent, appConfig)
6+
.catch((err) => console.error(err));

0 commit comments

Comments
 (0)