Quick Adjustment

In this lesson, we'll make some quick adjustments to the input component.

We’re going to make a quick adjustment to the input component that we created. At the moment, we’re using the following condition on the <input> element and <ng-container> placeholder:

control.dirty && control.touched && control.errors

We’ll want to outsource this into a method so that we won’t have to repeat it. It will also clean things up a bit in the template. In the input.component.ts component class, we’ll define a method called showMsg().

Get hands-on with 1200+ tech skills courses.