Skip to content

Commit 317f41e

Browse files
angular-robotthePunderWoman
authored andcommitted
build: update dependency ngx-progressbar to v13 (angular#58822)
See associated pull request for more information. Closes angular#58696 as a pr takeover PR Close angular#58822
1 parent 7fd034e commit 317f41e

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

adev/src/app/core/layout/progress-bar/progress-bar.component.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ describe('ProgressBarComponent', () => {
2626
});
2727

2828
it('should call progressBar.complete() on route change', async () => {
29-
const progressBarCompleteSpy = spyOn(component.progressBar, 'complete');
29+
const progressBar = component.progressBar();
30+
const progressBarCompleteSpy = spyOn(progressBar, 'complete');
3031

3132
const harness = await RouterTestingHarness.create();
3233
await harness.navigateByUrl('/');

adev/src/app/core/layout/progress-bar/progress-bar.component.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ import {
1212
inject,
1313
OnInit,
1414
PLATFORM_ID,
15-
ViewChild,
15+
Signal,
16+
viewChild,
1617
} from '@angular/core';
1718
import {isPlatformBrowser} from '@angular/common';
18-
import {NgProgressbar} from 'ngx-progressbar';
19+
import {NgProgressbar, NgProgressRef} from 'ngx-progressbar';
1920
import {
2021
NavigationCancel,
2122
NavigationEnd,
@@ -41,7 +42,7 @@ export const PROGRESS_BAR_DELAY = 30;
4142
export class ProgressBarComponent implements OnInit {
4243
private readonly router = inject(Router);
4344

44-
@ViewChild(NgProgressbar, {static: true}) progressBar!: NgProgressbar;
45+
progressBar = viewChild.required(NgProgressRef);
4546

4647
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
4748

@@ -62,7 +63,7 @@ export class ProgressBarComponent implements OnInit {
6263
map(() => {
6364
// Only apply set the property if the navigation is not "immediate"
6465
return setTimeout(() => {
65-
this.progressBar.start();
66+
this.progressBar().start();
6667
}, PROGRESS_BAR_DELAY);
6768
}),
6869
switchMap((timeoutId) => {
@@ -83,7 +84,7 @@ export class ProgressBarComponent implements OnInit {
8384
.subscribe((timeoutId) => {
8485
// When the navigation finishes, prevent the navigating class from being applied in the timeout.
8586
clearTimeout(timeoutId);
86-
this.progressBar.complete();
87+
this.progressBar().complete();
8788
});
8889
}
8990
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
"magic-string": "^0.30.8",
127127
"memo-decorator": "^2.0.1",
128128
"ngx-flamegraph": "0.0.12",
129-
"ngx-progressbar": "^12.0.0",
129+
"ngx-progressbar": "^13.0.0",
130130
"open-in-idx": "^0.1.1",
131131
"protractor": "^7.0.0",
132132
"reflect-metadata": "^0.2.0",

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12473,10 +12473,10 @@ [email protected]:
1247312473
dependencies:
1247412474
tslib "^2.0.0"
1247512475

12476-
ngx-progressbar@^12.0.0:
12477-
version "12.0.2"
12478-
resolved "https://registry.yarnpkg.com/ngx-progressbar/-/ngx-progressbar-12.0.2.tgz#d64db421df75a3692c87945ed794d32370c48172"
12479-
integrity sha512-/XPobMc2b8Z/vTYmvyyt6i/Wm0S08xRfawdqG9LVefhMCRyIFkuq0p0vk1tzT6luvzft3BVT+b6rPR/2iBEZuA==
12476+
ngx-progressbar@^13.0.0:
12477+
version "13.0.0"
12478+
resolved "https://registry.yarnpkg.com/ngx-progressbar/-/ngx-progressbar-13.0.0.tgz#8054ef717218de9778fe4a42f502141438c376e7"
12479+
integrity sha512-vzycISa9kddf2eo1qF7WSrHPLFRR0dia2NaxYFCSnvspJ30D69OBN8qV9gZ0BLU+AQib5I3CGhDbjF6QqvKtzA==
1248012480
dependencies:
1248112481
tslib "^2.0.0"
1248212482

0 commit comments

Comments
 (0)