I have an object that has 2 fields, while 1 should be less than or equal to another.
Say it's HDD quota settings and I need the threshold to be less than or equal to HDD's size.
I am trying to use angular's ui-utils#validate.
This is how I got so far: http://embed.plnkr.co/EysaRdu2vuuyXAXJcJmE/preview (i hope the link will work)
The problem that I am having is that it works to one direction:
Setting size and then playing with threshold works ok
But if I try to change size, after threshold is in invalid state - nothing happens. This is because invalid threshold is not set on the model and size id being compared against null or undefined (or something like that).
On one hand I understand the logic of not setting invalid value on the model... but here it is getting in my way.
So, any help making this work will be appreciated.