Angular 2 Reactive Forms vs Template Forms [英] Angular 2 Reactive Forms vs Template Forms

查看:135
本文介绍了Angular 2 Reactive Forms vs Template Forms的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在启动一个新的Angular 2项目,并正在考虑是否使用Reactive Forms或Template Forms。阅读背景:



这是我在Pluralsight中的Forms课程中的幻灯片。其中一些观点可能是有争议的,但我与来自开发Forms的Angular团队的人一起合作了这个列表。


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 Reactive Forms vs Template Forms的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆