Skip to content

Commit 3a7add8

Browse files
authored
Updated project to angular v19 (#793)
1 parent b631c8f commit 3a7add8

25 files changed

+3061
-2902
lines changed

angular.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@
99
"projectType": "application",
1010
"architect": {
1111
"build": {
12-
"builder": "@angular-devkit/build-angular:browser",
12+
"builder": "@angular-devkit/build-angular:application",
1313
"options": {
14-
"outputPath": "dist",
14+
"outputPath": {
15+
"base": "dist"
16+
},
1517
"index": "src/index.html",
16-
"main": "src/main.ts",
1718
"tsConfig": "src/tsconfig.json",
18-
"polyfills": "src/polyfills.ts",
19+
"polyfills": [
20+
"src/polyfills.ts"
21+
],
1922
"assets": [
2023
"src/assets",
2124
"src/favicon.ico"
@@ -24,12 +27,11 @@
2427
"src/styles.css"
2528
],
2629
"scripts": [],
27-
"vendorChunk": true,
2830
"extractLicenses": false,
29-
"buildOptimizer": false,
3031
"sourceMap": true,
3132
"optimization": false,
32-
"namedChunks": true
33+
"namedChunks": true,
34+
"browser": "src/main.ts"
3335
},
3436
"configurations": {
3537
"production": {
@@ -44,8 +46,6 @@
4446
"sourceMap": false,
4547
"namedChunks": false,
4648
"extractLicenses": true,
47-
"vendorChunk": false,
48-
"buildOptimizer": true,
4949
"fileReplacements": [
5050
{
5151
"replace": "src/environments/environment.ts",

package.json

+15-21
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,35 @@
1414
"ng": "ng",
1515
"start": "ng serve --configuration production",
1616
"build": "ng build --configuration production",
17-
"test": "npm run build && cypress-runner run",
18-
"test:open": "npm run build && cypress-runner open",
17+
"test": "npm run build && cypress-runner run --path=dist/browser",
18+
"test:open": "npm run build && cypress-runner open --path=dist/browser",
1919
"e2e": "npm run test",
20-
"gh-pages": "ng build --base-href=/sample-app-angular/ && shx rm -rf pages && shx mkdir pages && cd pages && git init && git remote add pages [email protected]:ui-router/sample-app-angular.git && git fetch pages && git checkout gh-pages && git rm -rf * && shx mv ../dist/* . && git add . && git commit -m 'Update gh-pages' . && git push && cd .. && shx rm -rf pages"
20+
"gh-pages": "ng build --base-href=/sample-app-angular/ && shx rm -rf pages && shx mkdir pages && cd pages && git init && git remote add pages [email protected]:ui-router/sample-app-angular.git && git fetch pages && git checkout gh-pages && git rm -rf * && shx mv ../dist/browser/* . && git add . && git commit -m 'Update gh-pages' . && git push && cd .. && shx rm -rf pages"
2121
},
2222
"private": true,
2323
"dependencies": {
24-
"@angular/common": "^18.0.6",
25-
"@angular/compiler": "^18.0.6",
26-
"@angular/core": "^18.0.6",
27-
"@angular/forms": "^18.0.6",
28-
"@angular/platform-browser": "^18.0.6",
29-
"@angular/platform-browser-dynamic": "^18.0.6",
24+
"@angular/common": "^19.0.5",
25+
"@angular/compiler": "^19.0.5",
26+
"@angular/core": "^19.0.5",
27+
"@angular/forms": "^19.0.5",
28+
"@angular/platform-browser": "^19.0.5",
29+
"@angular/platform-browser-dynamic": "^19.0.5",
3030
"@uirouter/angular": "^14.0.0",
3131
"@uirouter/core": "6.1.0",
3232
"@uirouter/rx": "1.0.0",
3333
"@uirouter/visualizer": "^7.2.1",
34-
"core-js": "^2.5.7",
3534
"rxjs": "^7.4.0",
36-
"rxjs-compat": "^6.6.7",
37-
"ts-helpers": "^1.1.2",
38-
"tslib": "^2.3.1",
39-
"zone.js": "~0.14.3"
35+
"zone.js": "~0.15.0"
4036
},
4137
"devDependencies": {
42-
"@angular-devkit/build-angular": "^18.0.7",
43-
"@angular/animations": "^18.0.6",
44-
"@angular/cli": "^18.0.7",
45-
"@angular/compiler-cli": "^18.0.6",
38+
"@angular-devkit/build-angular": "^19.0.6",
39+
"@angular/animations": "^19.0.5",
40+
"@angular/cli": "^19.0.6",
41+
"@angular/compiler-cli": "^19.0.5",
4642
"@types/jasmine": "~3.10.2",
4743
"@uirouter/cypress-runner": "^3.0.0",
48-
"html-webpack-plugin": "5.5.0",
49-
"shx": "^0.3.3",
5044
"tslint": "6.1.3",
51-
"typescript": "~5.4.5"
45+
"typescript": "~5.6.3"
5246
},
5347
"packageManager": "[email protected]+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
5448
}

src/app/app.component.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import { AppConfigService } from './global/app-config.service';
1212
* It has a `ui-view` viewport for nested states to fill in.
1313
*/
1414
@Component({
15-
selector: 'app-root',
16-
template: `
15+
selector: 'app-root',
16+
template: `
1717
<div #dialogdiv></div>
1818
<div class="navheader">
1919
<ul *ngIf="isAuthenticated" class="nav nav-tabs">
@@ -42,9 +42,9 @@ import { AppConfigService } from './global/app-config.service';
4242
</div>
4343
4444
<ui-view></ui-view>
45-
`
46-
,
47-
styles: []
45+
`,
46+
styles: [],
47+
standalone: false
4848
})
4949
export class AppComponent implements OnInit {
5050
@ViewChild('dialogdiv', { read: ViewContainerRef, static: true }) dialogdiv;

src/app/contacts/contact-detail.component.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { Component, Input } from '@angular/core';
44
* This component renders a read only view of the details for a single contact.
55
*/
66
@Component({
7-
selector: 'app-contact-detail',
8-
template: `
7+
selector: 'app-contact-detail',
8+
template: `
99
<div class="flex-h">
1010
<div class="details">
1111
<h3>{{contact.name.first}} {{contact.name.last}}</h3>
@@ -25,9 +25,9 @@ import { Component, Input } from '@angular/core';
2525
<img [src]="contact.picture"/>
2626
</div>
2727
</div>
28-
`
29-
,
30-
styles: []
28+
`,
29+
styles: [],
30+
standalone: false
3131
})
3232
export class ContactDetailComponent {
3333
@Input() contact;

src/app/contacts/contact-list.component.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { Component, Input } from '@angular/core';
77
* Each list item is a clickable link to the `contacts.contact` details substate
88
*/
99
@Component({
10-
selector: 'app-contact-list',
11-
template: `
10+
selector: 'app-contact-list',
11+
template: `
1212
<ul class="selectlist list-unstyled">
1313
<li>
1414
<!-- This link is a relative ui-sref to the contacts.new state. -->
@@ -31,7 +31,8 @@ import { Component, Input } from '@angular/core';
3131
</li>
3232
</ul>
3333
`,
34-
styles: []
34+
styles: [],
35+
standalone: false
3536
})
3637
export class ContactListComponent {
3738
@Input() contacts;

src/app/contacts/contact.component.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { Component, Input } from '@angular/core';
77
* Another button edits the contact by linking to `contacts.contact.edit` state.
88
*/
99
@Component({
10-
selector: 'app-contact',
11-
template: `
10+
selector: 'app-contact',
11+
template: `
1212
<div class="contact">
1313
<app-contact-detail [contact]="contact"></app-contact-detail>
1414
@@ -25,7 +25,8 @@ import { Component, Input } from '@angular/core';
2525
<ui-view></ui-view>
2626
</div>
2727
`,
28-
styles: []
28+
styles: [],
29+
standalone: false
2930
})
3031
export class ContactComponent {
3132
@Input() contact;

src/app/contacts/contacts.component.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { Component, Input } from '@angular/core';
77
* On the right is the ui-view viewport where contact details appear.
88
*/
99
@Component({
10-
selector: 'app-contacts',
11-
template: `
10+
selector: 'app-contacts',
11+
template: `
1212
<div class="my-contacts flex-h">
1313
1414
<app-contact-list [contacts]="contacts" class="flex nogrow"></app-contact-list>
@@ -19,7 +19,8 @@ import { Component, Input } from '@angular/core';
1919
</ui-view>
2020
</div>
2121
`,
22-
styles: []
22+
styles: [],
23+
standalone: false
2324
})
2425
export class ContactsComponent {
2526
@Input() contacts;

src/app/contacts/edit-contact.component.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import { copy } from '../util/util';
2828
* the `reload: true` option re-fetches the contacts resolve data from the server
2929
*/
3030
@Component({
31-
selector: 'app-edit-contact',
32-
template: `
31+
selector: 'app-edit-contact',
32+
template: `
3333
<div class="contact">
3434
<div class="details">
3535
<div><label>First</label><input type="text" [(ngModel)]="contact.name.first"></div>
@@ -55,7 +55,8 @@ import { copy } from '../util/util';
5555
</div>
5656
</div>
5757
`,
58-
styles: []
58+
styles: [],
59+
standalone: false
5960
})
6061
export class EditContactComponent implements OnInit {
6162
@Input() pristineContact;

src/app/global/dialog.component.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { Component, OnInit, HostBinding } from '@angular/core';
22
import { wait } from '../util/util';
33

44
@Component({
5-
selector: 'app-dialog',
6-
template: `
5+
selector: 'app-dialog',
6+
template: `
77
<div class="backdrop" [class.active]="visible"></div>
88
<div class='wrapper'>
99
<div class="content">
@@ -17,7 +17,8 @@ import { wait } from '../util/util';
1717
</div>
1818
</div>
1919
`,
20-
styles: []
20+
styles: [],
21+
standalone: false
2122
})
2223
export class DialogComponent implements OnInit {
2324
@HostBinding('class.dialog') dialog = true;

src/app/home.component.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { Component, OnInit } from '@angular/core';
22
// This is a home component for authenticated users.
33
// It shows giant buttons which activate their respective submodules: Messages, Contacts, Preferences
44
@Component({
5-
selector: 'app-home',
6-
template: `
5+
selector: 'app-home',
6+
template: `
77
<div class="home buttons">
88
<button uiSref="mymessages" class="btn btn-primary">
99
<h1><i class="fa fa-envelope"></i></h1>
@@ -21,7 +21,8 @@ import { Component, OnInit } from '@angular/core';
2121
</button>
2222
</div>
2323
`,
24-
styles: []
24+
styles: [],
25+
standalone: false
2526
})
2627
export class HomeComponent {
2728
constructor() { }

src/app/login.component.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import { AppConfigService } from './global/app-config.service';
1010
* It shows errors if the authentication failed for any reason.
1111
*/
1212
@Component({
13-
selector: 'app-login',
14-
template: `
13+
selector: 'app-login',
14+
template: `
1515
<div class="container">
1616
<div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
1717
<h3>Log In</h3>
@@ -53,7 +53,8 @@ import { AppConfigService } from './global/app-config.service';
5353
</div>
5454
</div>
5555
`,
56-
styles: []
56+
styles: [],
57+
standalone: false
5758
})
5859
export class LoginComponent {
5960
@Input() returnTo: TargetState;

src/app/main.component.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { Component } from '@angular/core';
22

33
@Component({
4-
selector: 'app-main',
5-
template: `<ui-view>Loading...</ui-view>`
4+
selector: 'app-main',
5+
template: `<ui-view>Loading...</ui-view>`,
6+
standalone: false
67
})
78
export class MainComponent {}

src/app/mymessages/compose.component.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import { copy } from '../util/util';
1414
* A Send button sends the message
1515
*/
1616
@Component({
17-
selector: 'app-compose',
18-
template: `
17+
selector: 'app-compose',
18+
template: `
1919
<div class="compose">
2020
<div class="header">
2121
<div class="flex-h"> <label>Recipient</label> <input type="text" id="to" name="to" [(ngModel)]="message.to"> </div>
@@ -34,7 +34,8 @@ import { copy } from '../util/util';
3434
</div>
3535
</div>
3636
`,
37-
styles: []
37+
styles: [],
38+
standalone: false
3839
})
3940
export class ComposeComponent implements OnInit {
4041
// data

src/app/mymessages/folder-list.component.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { Component, Input } from '@angular/core';
44
* Renders a list of folders
55
*/
66
@Component({
7-
selector: 'app-folder-list',
8-
template: `
7+
selector: 'app-folder-list',
8+
template: `
99
<!-- Renders a list of folders -->
1010
<div class="folderlist">
1111
<ul class="selectlist list-unstyled">
@@ -20,7 +20,8 @@ import { Component, Input } from '@angular/core';
2020
</ul>
2121
</div>
2222
`,
23-
styles: []
23+
styles: [],
24+
standalone: false
2425
})
2526
export class FolderListComponent {
2627
@Input() folders: any[];

src/app/mymessages/format-message.pipe.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { Pipe, PipeTransform } from '@angular/core';
22

33
@Pipe({
4-
name: 'formatMessage'
4+
name: 'formatMessage',
5+
standalone: false
56
})
67
export class FormatMessagePipe implements PipeTransform {
78
transform(value: string, args?: any): string {

src/app/mymessages/message-list.component.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import { Message } from './interface';
66
* This component renders a list of messages using the `messageTable` component
77
*/
88
@Component({
9-
selector: 'app-message-list',
10-
template: `
9+
selector: 'app-message-list',
10+
template: `
1111
<div class="messages">
1212
<app-message-table [columns]="folder.columns" [messages]="messages$ | async"></app-message-table>
1313
</div>
1414
`,
15-
styles: []
15+
styles: [],
16+
standalone: false
1617
})
1718
export class MessageListComponent {
1819
@Input() folder;

src/app/mymessages/message-table.component.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import { Component, Input } from '@angular/core';
1010
* Shows/hides specific columns based on the `columns` input binding.
1111
*/
1212
@Component({
13-
selector: 'app-message-table',
14-
template: `
13+
selector: 'app-message-table',
14+
template: `
1515
<table>
1616
<thead>
1717
<tr>
@@ -36,7 +36,8 @@ import { Component, Input } from '@angular/core';
3636
3737
</table>
3838
`,
39-
styles: []
39+
styles: [],
40+
standalone: false
4041
})
4142
export class MessageTableComponent {
4243
@Input() columns: any[];

0 commit comments

Comments
 (0)