Alain Chautard
1 min readMar 21, 2019

--

You can create an @Input attribute called “required” and have this bound to the “required” property of your text input. Another thing I usually do is have an abstract class that does all of the above and then any component that I want to turn into a custom form element extends it. That way the code is written just once.

--

--

Alain Chautard
Alain Chautard

Written by Alain Chautard

Google Developer Expert in Angular, Consultant and Trainer at http://www.angulartraining.com

No responses yet