1

Currently I have a input type="text" with ReactiveForms. Angular always adds ng-xxx css classes (e.g. ng-valid)

I'd like to disable this all together (I know I can just change the appropriate css classes)

Is it possible to disable validation completley (including css etc.) for a single input field?

see https://stackblitz.com/edit/angular-fjmyzc for an example

3
  • You probably didn't save your stackblitz, the link got me to the default angular project example. Commented Mar 6, 2018 at 12:33
  • sorry, saved it now Commented Mar 6, 2018 at 12:42
  • btw, it is almost just the default angular project. I only added an input Commented Mar 6, 2018 at 12:52

1 Answer 1

3

If you are using FormControls than the ng-xxxx classes will apply to form elements as they are the core building block of the form control to work with form element on the DOM. I don't know why you want to disable these classes but if you are not using them you should ignore them, all these classes are optional and doesn't contains any styling on their own and to differentiate it as angular styling these are prefixed with "ng"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.