Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required. Paperback excluded.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Essential Angular

You're reading from   Essential Angular Fast paced guide to Front-end web development with Angular

Arrow left icon
Product type Paperback
Published in May 2017
Publisher Packt
ISBN-13 9781788293761
Length 108 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (3):
Arrow left icon
Narwhal Technologies Inc Narwhal Technologies Inc
Author Profile Icon Narwhal Technologies Inc
Narwhal Technologies Inc
Jeff Cross Jeff Cross
Author Profile Icon Jeff Cross
Jeff Cross
Victor Savkin Victor Savkin
Author Profile Icon Victor Savkin
Victor Savkin
Arrow right icon
View More author details
Toc

Wrapping up

Form handling is a complex problem. One of the main reasons AngularJS got so successful is that two-way bindings and ng-model provided a good solution for it. But there were some downsides, mainly complex forms built with ng-model made the data flow of the application hard to follow and debug. Angular 2+ builds up on the ideas from Angular 1, but avoids its problems.

NgModel and friends are no longer part of the core framework. The @angular/core package only contains the primitives we can use to build a form-handling module. Instead, Angular has a separate package—@angular/forms—that comes with FormsModule and ReactiveFormsModule that provide two different styles of handling user input.

Both the modules depend on the form model consisting of FormControl, FormGroup, and FormArray. Having this UI-independent model, we can model and test input handling without rendering any components.

Finally...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime