ProgressBarService manages the state and configuration of the progress bar displayed in the toolbar. It provides methods to show different progress bar modes (indeterminate, query, buffer) and hide the progress bar.
Location
src/app/services/progress-bar/progress-bar.service.ts
Properties
Read-only signal containing the current progress bar configuration including visibility, mode, and values.
Methods
showIndeterminateProgressBar()
Shows an indeterminate progress bar that animates continuously without a specific completion percentage.showQueryProgressBar()
Shows a query-style progress bar (reverse indeterminate animation from right to left).showBufferProgressBar(bufferValue, value)
Shows a buffer-style progress bar with both a primary value and buffer value.The buffer value (0-100) indicating cached or buffered progress
The primary value (0-100) indicating actual progress
hideProgressBar()
Hides the progress bar from view.ProgressBarConfiguration Interface
Usage with HTTP Interceptor
The service is automatically integrated with theprogressBarInterceptor which displays:
- Query mode for GET, HEAD, OPTIONS requests
- Indeterminate mode for POST, PUT, PATCH, DELETE requests
Implementation Details
- All configuration changes are queued with a 90ms debounce to prevent flickering
- State is managed via Angular signals for reactive updates
- The service is provided in root and available application-wide
- Used by the ToolbarComponent to display the progress bar
The progress bar automatically appears in the toolbar when
isVisible is true. No additional setup required.Related
- progressBarInterceptor - Automatically shows/hides progress for HTTP requests
- ToolbarComponent - Displays the progress bar