Skip to content

v0.4.0: fix: wrap self-referencing useExisting providers in forwardRef

Choose a tag to compare

@danielalexis danielalexis released this 23 Aug 16:26
· 13 commits to main since this release
Components using the { provide: TOKEN, useExisting: SelfClass }
pattern referenced their own class name before its declaration.
Angular's AOT compiler tolerates this, but plain tsc/tsserver flags
it as TS2449 (class used before its declaration). Wrapping in
forwardRef(() => SelfClass) is the standard fix and works under both.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>