-
Notifications
You must be signed in to change notification settings - Fork 366
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
Form controls values are not updated #155
Comments
@abdulhaq-e I had a quick look before work and in the sample app it's working. You need to update the value via
|
I replicated the code in the sample app and it worked. However, the original issue still exists and I now know what it is. This line |
Okay, learned something now. The reason the value is not emitted is because the setTimeOut( () => this.exampleModel.valueUpdates.next("My new value"), 2000); Now I'll have to figure how to do this programmatically. Probably using lifecycle hooks. |
import {AfterViewInit} from '@angular/core'
// component defined here
ngAfterViewInit() {
this.exampleModel.valueUpdates.next("My new value")
} I always postponed reading about Angular 2 lifecycle hooks. I learned them the hard way. Thanks. |
@abdulhaq-e Alright, no problem! Thanks for the clarification. |
Can i update id or any other properties of the control? |
With the exception of But be careful when updating values and disabled state (see README). |
Hello
I have a problem updating form control values. Using
valueUpdates
, I'm able to update thevalue
property of theDynamicFormModel
. This update however, is not reflected on the form control.The piece of code responsible for this update is L52-L57. What is happening in my case is that the subject is not pushing any values to the stream. For example, if I change those lines to:
The results: I can only see the first sentence in the log. The others do not appear because the subject has not emitted anything.
The text was updated successfully, but these errors were encountered: