Skip to content
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

ngFormModel does not support binding to dynamic properties #6306

Closed
VinnyVicious opened this issue Jan 6, 2016 · 2 comments
Closed

ngFormModel does not support binding to dynamic properties #6306

VinnyVicious opened this issue Jan 6, 2016 · 2 comments

Comments

@VinnyVicious
Copy link

I've been trying to work with ngFormModel and dynamic properties from classes, without any luck. What happens is that the first value is bound correctly, but as soon as i change the variable to another value, the ngFormModel is not updated to reflect that. Here's a small demo with what's going on:

http://plnkr.co/edit/XnbvYtPW9BFDMcdDp0St

In this demo, each Hero can have a specific HeroForm. Each HeroForm can contain different fields and values, that why the ngFormModel has to be dynamic. In my template, i'm binding ngFormModel to the form property of the current selectedHero. To reproduce the issue, select a hero, fill the form and submit. You'll see that everything is OK in the console. But try selecting another hero: now the form is always empty.

Also, another question in the same subject and demo: how can i have dynamic templates based on each HeroForm class? For example, AnotherHeroForm contains different fields than HeroForm, so, how can i have a markup for each?

@kara
Copy link
Contributor

kara commented Aug 29, 2016

@VinnyVicious This should have been fixed by #11051, which will be part of RC.6. Check it out again when it is released.

@kara kara closed this as completed Aug 29, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants