feat: add support for Angular signal inputs and outputs #12645
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for Angular 17.1+ signal-based inputs and outputs in mock components.
Files Created:
libs/ng-mocks/src/lib/common/decorate.signal-inputs.ts- Handles decoration of signal inputs on mock componentslibs/ng-mocks/src/lib/common/decorate.signal-outputs.ts- Handles decoration of signal outputs on mock componentstests/signal-inputs-outputs/test.spec.ts- Test file for signal inputs/outputsFiles Modified:
libs/ng-mocks/src/lib/common/core.types.ts- Added SignalInputDef and SignalOutputDef typeslibs/ng-mocks/src/lib/resolve/collect-declarations.ts- Added parsing of signal inputs/outputs from Angular's internal ɵcmp/ɵdir metadatalibs/ng-mocks/src/lib/mock/decorate-declaration.ts- Added calls to decorate signal inputs/outputsHow it works:
isSignal: truein their metadatasubscribe()andemit()methods for testingUsage in tests:
The implementation maintains backward compatibility - it only activates for components that use signal inputs/outputs (Angular 17.1+).
Split from PR #12594 which combines both Angular 21 upgrade and signal support
🤖 Generated with Claude Code