0

I know I can make Angular validate inputs against regex, so I can allow/deny certain values. But is there a way to validate an input value against a custom function?

For example, say that the input value is pushed in an array and I want to check if the value of the input is already in the array.

Also, I want to be able to mark the input as invalid or required, the same way Angular would do it if I was using plain regex.

3
  • ng-change? If the value changes do something Commented Jun 17, 2015 at 16:53
  • @Fals How would I set the state to invalid from there? Commented Jun 17, 2015 at 16:58
  • 1
    You could use ui-validate as per this stack overflow? Commented Jun 17, 2015 at 17:01

0

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.