build: update dependency ngx-progressbar to v13 (#58822)

See associated pull request for more information.

Closes #58696 as a pr takeover

PR Close #58822
This commit is contained in:
Angular Robot 2024-11-16 02:35:43 +00:00 committed by Jessica Janiuk
parent 78cf51b12a
commit d69a4e1e15
4 changed files with 13 additions and 11 deletions

View file

@ -26,7 +26,8 @@ describe('ProgressBarComponent', () => {
});
it('should call progressBar.complete() on route change', async () => {
const progressBarCompleteSpy = spyOn(component.progressBar, 'complete');
const progressBar = component.progressBar();
const progressBarCompleteSpy = spyOn(progressBar, 'complete');
const harness = await RouterTestingHarness.create();
await harness.navigateByUrl('/');

View file

@ -12,10 +12,11 @@ import {
inject,
OnInit,
PLATFORM_ID,
ViewChild,
Signal,
viewChild,
} from '@angular/core';
import {isPlatformBrowser} from '@angular/common';
import {NgProgressbar} from 'ngx-progressbar';
import {NgProgressbar, NgProgressRef} from 'ngx-progressbar';
import {
NavigationCancel,
NavigationEnd,
@ -41,7 +42,7 @@ export const PROGRESS_BAR_DELAY = 30;
export class ProgressBarComponent implements OnInit {
private readonly router = inject(Router);
@ViewChild(NgProgressbar, {static: true}) progressBar!: NgProgressbar;
progressBar = viewChild.required(NgProgressRef);
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
@ -62,7 +63,7 @@ export class ProgressBarComponent implements OnInit {
map(() => {
// Only apply set the property if the navigation is not "immediate"
return setTimeout(() => {
this.progressBar.start();
this.progressBar().start();
}, PROGRESS_BAR_DELAY);
}),
switchMap((timeoutId) => {
@ -83,7 +84,7 @@ export class ProgressBarComponent implements OnInit {
.subscribe((timeoutId) => {
// When the navigation finishes, prevent the navigating class from being applied in the timeout.
clearTimeout(timeoutId);
this.progressBar.complete();
this.progressBar().complete();
});
}
}

View file

@ -126,7 +126,7 @@
"magic-string": "^0.30.8",
"memo-decorator": "^2.0.1",
"ngx-flamegraph": "0.0.12",
"ngx-progressbar": "^12.0.0",
"ngx-progressbar": "^13.0.0",
"open-in-idx": "^0.1.1",
"protractor": "^7.0.0",
"reflect-metadata": "^0.2.0",

View file

@ -12473,10 +12473,10 @@ ngx-flamegraph@0.0.12:
dependencies:
tslib "^2.0.0"
ngx-progressbar@^12.0.0:
version "12.0.2"
resolved "https://registry.yarnpkg.com/ngx-progressbar/-/ngx-progressbar-12.0.2.tgz#d64db421df75a3692c87945ed794d32370c48172"
integrity sha512-/XPobMc2b8Z/vTYmvyyt6i/Wm0S08xRfawdqG9LVefhMCRyIFkuq0p0vk1tzT6luvzft3BVT+b6rPR/2iBEZuA==
ngx-progressbar@^13.0.0:
version "13.0.0"
resolved "https://registry.yarnpkg.com/ngx-progressbar/-/ngx-progressbar-13.0.0.tgz#8054ef717218de9778fe4a42f502141438c376e7"
integrity sha512-vzycISa9kddf2eo1qF7WSrHPLFRR0dia2NaxYFCSnvspJ30D69OBN8qV9gZ0BLU+AQib5I3CGhDbjF6QqvKtzA==
dependencies:
tslib "^2.0.0"