Angular 2 反应式表单与模板表单 [英] Angular 2 Reactive Forms vs Template Forms
问题描述
我们正在启动一个新的 Angular 2 项目,并正在考虑是使用响应式表单还是模板表单.背景阅读:
这是我的 Pluralsight 表单课程的幻灯片.其中一些观点可能存在争议,但我与来自 Angular 团队的开发 Forms 的人一起整理了这个列表.
We are starting a new Angular 2 project and are considering whether to use Reactive Forms or Template Forms. Background reading here: https://angular.io/guide/reactive-forms
As far as I can tell, the biggest advantage of Reactive Forms is that they're synchronous, but we have simple forms and I don't think asynchronicity will cause us issues. There seems to be much more overhead with Reactive, on the surface more code to do the same things.
Can someone provide a solid use case where i would use Reactive over the simpler Template Forms?
This is a slide from my course on Forms in Pluralsight. Some of these points may be arguable, but I worked with the person from the Angular team that developed Forms to put together this list.
这篇关于Angular 2 反应式表单与模板表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!