Inheriting validation using ControlValueAccessor in Angular

You can get access of the NgControl through DI. NgControl has all the information about validation status. To retrieve NgControl you should not provide your component through NG_VALUE_ACCESSOR instead you should set the accessor in the constructor. @Component({ selector: ‘custom-form-comp’, templateUrl: ‘..’, styleUrls: … }) export class CustomComponent implements ControlValueAccessor { constructor(@Self() @Optional() private control: …

Read more

The form component needs to have a UIForm in its ancestry. Suggestion: enclose the necessary components within

This is just a Warning not an Error. Warnings are usually there to inform the developer about unforeseen situations/conditions which might not immediately cause technical errors/problems. Anything may just work flawlessly, but the behaviour/results may probably not be as the developer intented. A newbie developer may for example accidently have used <form> instead of <h:form>. …

Read more

Show red border for all invalid fields after submitting form angularjs

Reference article: Show red color border for invalid input fields angualrjs I used ng-class on all input fields.like below <input type=”text” ng-class=”{submitted:newEmployee.submitted}” placeholder=”First Name” data-ng-model=”model.firstName” id=”FirstName” name=”FirstName” required/> when I click on save button I am changing newEmployee.submitted value to true(you can check it in my question). So when I click on save, a class …

Read more