What We Learned

Forms are one of the areas where Rx is most effective in simplifying common frontend tasks. This goes doubly so, when coupled with a framework like Angular to handle all of the intermediate connections for you. With these two tools combined, you’re equipped to build powerful, easy-to-use forms without skimping on key features. Your forms can now include validation that’s helpful, react quickly to user input, and involve seemingly complex controls.

There’s still more that RxJS can do for you in the world of Angular. In this chapter, the form held all the state of the page. In the next chapter, you’ll learn about ngrx, a centralized state management system that sits on top of RxJS, as well as using clever RxJS tricks to track and optimize the performance of an Angular web application.

If you’re still hungry for more challenge after finishing the projects in this chapter, here’s a few suggestions about how to expand the pizza forms.

Create Stricter Validation

While our registration form has fairly comprehensive validation rules, there are a few more corner cases you can tackle. How would you ensure that the expiration date entered for a credit card is in the future? How can you support more formats and types of phone numbers (hint: this might require more than a regex)?

Add More Items to Order

Pizza joints sell more than just pizza. How would you add soda, garlic bread, and similar items into the current form model? Would you use separate subforms like the pizzas or just another component? What would the form model look like?

New Specialty Pizzas

Not everyone thinks that pineapple and ham make a good pizza. How would you let a user create and customize their own specialty pizzas? Where would that be stored?

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.172.93