Install
LogoSoupService
The Angular adapter provides an@Injectable service that wraps the core engine using Angular signals. Provide it per component instance so each <logo-soup> gets its own engine with independent state and caching.
Service API
LogoSoupService
An @Injectable that wraps the core engine.
| Member | Type | Description |
|---|---|---|
state | Signal<LogoSoupState> | Readonly signal containing the engine’s current state |
process(options) | (ProcessOptions) => void | Trigger a processing run with new options |
state signal contains:
Scoping
Provide the service at the component level viaproviders:
Reactive Options with Signals
Sinceeffect() automatically tracks signal reads, any input signal change re-triggers processing:
Dark Mode
PassbackgroundColor for proper contrast detection on opaque logos:
Loading and Error States
Read thestatus field from the state signal:
Visual Center Alignment
Apply visual center alignment withgetVisualCenterTransform from the core package:
Computed Helpers
Use Angular’scomputed() to derive values from the state signal:
Cleanup
The service usesDestroyRef.onDestroy() internally to unsubscribe from the engine and clean up blob URLs when the component is destroyed. You don’t need to handle cleanup manually.
How It Works Under the Hood
The Angular adapter bridges the core engine to Angular’s signal-based reactivity:signal()holds the engine state with.asReadonly()for public access — private writable, public readonly (Angular best practice for encapsulated state)engine.subscribe()pushes state changes into the Angular signal via_state.set()DestroyRef.onDestroy()unsubscribes and destroys the engine when the injector is torn down — the modern Angular cleanup API (replacesOnDestroylifecycle hook)ChangeDetectionStrategy.OnPushis recommended since signals drive change detection, eliminating the need for the default strategyinput()/input.required()are used instead of the@Input()decorator — this is the Angular 19+ way@forwithtrackis used instead of*ngFor— Angular 19+ built-in control flow