Open kesavamoorthi-gk opened 7 months ago
You don't need to add it to every component, just add it to your AppComponent
and enable it on router events
eg:
ngOnInit() {
this.router.events.pipe(
filter(
(e) =>
e instanceof NavigationStart ||
e instanceof NavigationEnd ||
e instanceof NavigationCancel ||
e instanceof NavigationError
),
map((e) => e instanceof NavigationStart)
).pipe(
//takeUntil(this.Destroy$),
//delay(100)
)
.subscribe(
isRouteLoading => {
this.isLoading = isRouteLoading;
},
);
}
Instead of incorporating NgxSpinnerService individually in each component, implement a feature to utilize NgxSpinnerService within an Interceptor to eliminate redundancy.