Registry / web-framework / ngx-fastboot

ngx-fastboot

JSON →
library2.1.0jsnpmunverified

ngx-fastboot is an Angular library for dynamically loading configuration at runtime, optimizing startup performance by lazy-loading providers. The current stable version is 2.1.0, released February 2025. It requires Angular 19 and Node >=20.10.0. Key differentiators: unlike typical static environment files, ngx-fastboot allows configurations to be loaded asynchronously via HTTP or custom sources and bundled into a separate chunk for faster initial loads. It provides fastBootstrapApplication, withProviders, and lazyRootComponent helpers. The library ships TypeScript types and follows Angular's standalone component pattern.

npm install ngx-fastboot
INSTALL
IMPORT
SIG · NGX-FASTBOOT
N
ngx-fastboot
web-frameworkjavascriptv2.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

fastBootstrapApplication
import { fastBootstrapApplication } from 'ngx-fastboot';
import fastBootstrapApplication from 'ngx-fastboot';
Named export, not default.
withProviders
import { withProviders } from 'ngx-fastboot';
import { WithProviders } from 'ngx-fastboot';
CamelCase with lowercase 'w'.
lazyRootComponent
import { lazyRootComponent } from 'ngx-fastboot';
import { LazyRootComponent } from 'ngx-fastboot';
CamelCase with lowercase 'l'.
type AppConfig
import type { AppConfig } from 'ngx-fastboot';
import { AppConfig } from 'ngx-fastboot';
Use type import to avoid runtime overhead.

Bootstraps an Angular app with lazy configuration loaded via HTTP. Uses fastBootstrapApplication and withProviders to defer config providers.

import { fastBootstrapApplication, withProviders } from 'ngx-fastboot'; import { provideHttpClient } from '@angular/common/http'; import { AppComponent } from './app.component'; // Config loader factory - must return a promise of providers const configProviders = () => fetch('/config.json').then(res => res.json()).then(config => [ { provide: 'APP_CONFIG', useValue: config }, ]); // Bootstrap fastBootstrapApplication(AppComponent, { providers: [ provideHttpClient(), withProviders(configProviders), // lazy-loaded providers ], });
Debug
Known issues
breakingAngular 18 no longer supported in v2.0.0
fix
Upgrade to Angular 19 or stay on v1.x for Angular 18 support.
affects: >=2.0.0
breakingv2.0.0 replaced bootstrapApplication with fastBootstrapApplication. Old API no longer works.
fix
Use fastBootstrapApplication instead of bootstrapApplication when using ngx-fastboot.
affects: >=2.0.0
deprecatedwithProviders was renamed from provideFastBoot in older versions; the old name is deprecated.
fix
Use withProviders instead of provideFastBoot.
affects: >=1.3.0
gotchafastBootstrapApplication expects providers array with withProviders, not a direct call. If you forget withProviders, config won't load.
fix
Wrap config loader in withProviders() and include in providers array.
affects: >=2.0.0
Errors
Common errors & fixes
Error: NG0203: inject() must be called from an injection context
Attempting to use inject() outside of an injection context, e.g., in a factory function not called by Angular.
fix
Ensure config loader functions are passed to withProviders, not called directly in providers array.
Error: No provider for InjectionToken APP_CONFIG
The configuration was not loaded when component tried to inject APP_CONFIG, likely because withProviders was not used or the config loading failed.
fix
Use withProviders to load config before app bootstrap, and handle fetch errors.
Upgrade
Version history
2.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
ngx-fastboot — npm install ngx-fastboot · libregistry