Search code examples
javascriptangularjsvalidationrequired

Read only fields validation in Angular JS


I want to display some dynamic data for that if field is empty I want to show "ABC is required" on load of page it self .

How do I do that ?


Solution

  • You'd write your validations as you normally would with the following added to the end of your validation expressions. || formName.$pristine

    This will trigger the validations on page load.