mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
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:
parent
78cf51b12a
commit
d69a4e1e15
4 changed files with 13 additions and 11 deletions
|
|
@ -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('/');
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue