Angular - Build a Reusable Reactive Form (like a PRO)

preview_player
Показать описание
In this Angular Tutorial you will learn how to build a #reusable #reactive form that you can use anywhere in your Angular application. Why would you wanna build a reusable form ? Actually the question is why shouldn’t you ? Reusable simply means it can be used again and that way you don’t have to build it from scratch or litter your #angular app with one same form!

Building a reusable form simply follows a programming principle called #DRY - Do Not Repeat Yourself - which aims at reducing repetition of software patterns.

So then, How do you build a reusable form in Angular ?

Well, Angular has a technique for sharing data between child and parent components. That is from parent to child and vice-versa. To implement this pattern you need to use the @Input and @Output decorators.

@Input() and @Output() give a child component a way to communicate with its parent component

@Input() lets the parent component update data in the child component while @Output() lets the child send data to a parent component

If you like this content, feel free to like and subscribe to the channel.

Checkout my GitHub for cool projects.
Рекомендации по теме
Комментарии
Автор

can we do this without using @input @output decorator? any alternative?

arnavpatil
Автор

But you only get value what if I want the status of form as well

khanafzal