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
expressionProperties function returning object does not update in Formly 6 #3068
Comments
expressionProperties
function returning object does not update in Formly 6
its ok as |
This issue has been fixed and released as part of v6.0.0-next.5 release. Please let us know, in case you are still encountering a similar issue/problem. |
FYI, StackBlitz now supports Angular 13:
Related StackBlitz issue comment: stackblitz/core#1657 (comment) |
Description
In Formly 6 when setting a template option to an object using an
expressionProperties
function,the value does not update in the field.
e.g. when accessing
to.json
from the field component it will always be the initial value "none", even whenmodel.input1
has a value:This works fine when returning a string or number instead of an object.
Is returning an object supported (it seems to work in Formly 5)?
Minimal Reproduction
Here is an example of it working the way I'd expect in Formly 5:
https://stackblitz.com/edit/angular-formly-5-expressions?file=src/app/app.component.ts
This same example should fail when run on Formly 6.0.0-next.1 and 6.0.0-next.4
(I tried to create a stackblitz using Angular 13 and Formly 6 but kept getting errors, is there a starter I can use?)
Your Environment
Additional context
I tested this on 6.0.0-next.1 and 6.0.0-next.4 and in both cases the value doesn't update.
When I log the template option from the field component using
ngDoCheck()
it looks like this:and if I click on it the getter always evaluates to the initial value I set (e.g. "test")
The text was updated successfully, but these errors were encountered: