简体   繁体   English

带有相关场的角度2动态形式

[英]angular 2 dynamic form with dependent fields

I need to create form with different blocks which depends on each other, some inputs should make other inputs appear/disappear, be required or change some other validations. 我需要创建具有彼此依赖的不同块的表单,一些输入应使其他输入出现/消失,需要或更改一些其他验证。

As far as I understand, template forms won't give me those features or it would be just kind of messy to scale. 据我所知,模板表单不会提供这些功能,否则将很难扩展。 So I looked into "reactive" forms since they would allow me to get config from back-end and render the form based on this config. 因此,我研究了“反应式”表单,因为它们使我可以从后端获取配置并根据此配置呈现表单。

But the problem is that, I have to implement material design in this project, specifically material.angular.io and right now, I have no idea how to get this all together in a working prototype. 但是问题在于, 我必须在该项目中实施材料设计,尤其是material.angular.io,而现在,我不知道如何在一个工作的原型中将所有这些结合在一起。

尝试使用Angular2可用的EventEmitters

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM