You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: