-
Notifications
You must be signed in to change notification settings - Fork 1
feat: angular 20 #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: fix/jss-rendering-signals
Are you sure you want to change the base?
feat: angular 20 #10
Conversation
| const componentRef = view.createComponent(rendering.componentImplementation); | ||
| componentRef.setInput('rendering', rendering.componentDefinition); | ||
| if (this._inputs) { | ||
| this._setComponentInputs(componentRef, this._inputs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Within this _setComponentInputs there is an issue, I don't know why it is an issue now, maybe something changed with setInput in Angular 20, but when it tries to set an input that doesn't exist on the component placed in a placeholder, it will throw an error.
This now happens with a lot of components in DynamicRow because the DynamicRow will try to set the context input on all components placed in a column.
I think we can change the _setComponentInputs to something like this (untested):
private _setComponentInputs(
componentRef: ComponentRef<unknown>,
inputs: { [key: string]: unknown }
) {
Object.entries(inputs).forEach(([input, inputValue]) => {
// Only set an input if it exists on the component
if (input in componentRef) {
componentRef.setInput(input, inputValue)
}
});
}related error
NG0303: Can't set value of the 'context' input on the '_MemberGetMemberWidgetComponent' component. Make sure that the 'context' property is declared as an input using the input() or model() function or the @Input() decorator.
Description / Motivation
Testing Details
Types of changes