angular: Update DOM when changing template in reactive form fails
I’m submitting a … (check one with “x”)
[ x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
Changing a reactive form template fails. When replacing the form, it throws an error: Error in ./App class App - inline template:0:6 caused by: control.registerOnChange is not a function
Expected behavior
It should not throw any error… and should change the template
Minimal reproduction of the problem with instructions
https://plnkr.co/edit/dJ1KyDLFDOOa1FUfWu5d?p=preview
Click on new template and check the console
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
NodeJS 7.4.0 running on Windows 10
-
Angular version: 2.4.7
-
Browser: Chrome 55 64bit
-
Language: Typescript
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 23 (8 by maintainers)
Commits related to this issue
- fix(form) fix #14376 — committed to ghetolay/angular by ghetolay 7 years ago
- fix(form) fix #14376 — committed to ghetolay/angular by ghetolay 7 years ago
- fix(forms) fix #14376 — committed to ghetolay/angular by ghetolay 7 years ago
- fix(forms) fix #14376 — committed to ghetolay/angular by ghetolay 7 years ago
- fix(forms): fix #14376 — committed to ghetolay/angular by ghetolay 7 years ago
@tbosch & @DzmitryShylovich 9 months now… any chance someone can look at this bug and fix it for v5? This is a real bug and it doesn’t even have the bug label.
Lets see, I’ll play a little bit “Product Manager” here
@ghetolay thinks:
@natcohen counters:
And I want to ask:
When using plain ECMAScript within a browser, can I change a form at runtime (post-creation)?
If the answer is “no”, then Angular
should
provide it (to be stronger than ECMAScript)If the answer is “yes”, then Angular
must
provide it, too, otherwise Angular is weaker than plain ECMAScript, which would be a shooting point (“What? Angular? Too restrictive, you even cannot modify a form at run-time.”).As for this issue:
should
requirement, then this issue becomes afeature-request
must
requirement, thin this issue becomes abug
(This classification should never take 3 months)
Either you want it or not: this is a Google led project, so one expects some level of professionalism here.
Am I wrong somewhere?
Accepting counters!
And bets!