What's Changed
π Angular 22 Support
- Upgraded the entire workspace β library, schematics, and demo app β to Angular 22, including
@angular/core,cdk,material,cli,build-angular,ng-packagr, and all supporting tooling. - Bumped TypeScript, ESLint (flat config, v10), Jasmine/Karma, and other dev dependencies to their Angular 22βcompatible versions.
- Migrated ESLint config from
.eslintrc.jsonto flateslint.config.js(required by ESLint 9+/angular-eslint22). - Fixed several strict-mode TypeScript compile errors surfaced by the newer toolchain.
π Fixed: spinner rendering behind MatDialog / CDK overlays
- Root cause: Angular CDK v21+ overlays (including
MatDialog) render in the browser's native top layer by default, which ignores normalz-indexstacking β so the spinner's oldposition: fixedoverlay could never appear above a dialog. - Fix: fullscreen spinners now also render via the native Popover API, so they participate in the same top layer and stack correctly above other overlays.
- New
[usePopover]@Input()(defaulttrue) to opt out per-instance, plus a matchingusePopoveroption onNgxSpinnerConfigfor a global default. Falls back automatically in browsers without Popover API support. No effect whenfullScreenisfalse.
π Fixed: ng add ngx-spinner was broken
- Fatal crash on install: the published
package.jsondeclares"type": "module", but the schematics were compiled as CommonJS with no override, causingexports is not defined in ES module scope. Fixed by scoping the schematics folder back to CommonJS. - Complete failure on standalone apps (the Angular default since v17): the schematic now detects standalone apps and inserts
NgxSpinnerModuleinto the bootstrapped root component'simportsarray instead of looking for anAppModule. - Crash when
--projectwasn't passed: added the missingschema.jsonso the Angular CLI can auto-resolve the current project. - Removed a redundant second
npm installstep that added unnecessary wait time and a potential failure point in offline/restricted-network CI.
β¨ New: optional HTTP interceptor
ngxSpinnerInterceptor(functional) andNgxSpinnerInterceptor(class-based) automatically show/hide the spinner around HTTP requests β no more manually callingNgxSpinnerServicefrom every component.- Tracks concurrent in-flight requests per spinner name, so the spinner only hides once every request has finished.
NGX_SPINNER_SKIPcontext token to opt individual requests out, andprovideNgxSpinnerHttpConfig()to set the target spinner name, extra options, and excluded URLs.- Entirely opt-in β existing
NgxSpinnerService/<ngx-spinner>usage is unaffected unless you register it.
π¨ Redesigned demo/playground site
- Ground-up visual redesign of the live demo: searchable animation gallery, a live preview stage driving the real
<ngx-spinner>component, a full configuration panel, a generated-code panel (HTML/TS) with one-click copy, and a dark/light theme toggle. - Dropped Angular Material and
ngx-color-pickerfrom the demo app in favor of custom-styled native controls β cut the demo bundle from ~651KB to ~200KB. - Restored an auto-hide-after-3-seconds safety net for the fullscreen preview, since a Popover-backed fullscreen spinner blocks clicks to everything underneath it, including its own dismiss button.
- Removed the outdated StackBlitz demo links.
π¦ Dependency/config cleanup
- Removed the library's own accidental self-dependency on
ngx-spinnerfrom the rootpackage.json. - Moved
@angular/cdktodevDependencies(only needed by the schematics build).
π Documentation
- README overhauled: new "What's New", updated "Features", new "HTTP Interceptor" section, expanded "Demo" section, refreshed Angular version support table, and removed the stale "Future Plan" section.
Full Changelog: v21.0.0...v22