>Why return an error - I'd just return true/false.
>
>ng-change should be ok but probably a good idea to add a debounce to the model options. Ideally something like:
ng-model-options="{ updateOn: 'default blur', debounce: {'default': 1000, 'blur': 0} }"
This would perform the check after 1sec. of inactivity, or immediately when the focus is moved.
I'd like to return the message explaining where this barcode is already used (e.g. which item). Here is how I'd like the interface to look (see attached).
So, as I understand it will involve setting the error (validation). This is the part I'm not 100% sure how to implement although I did a bit of research.
https://stackoverflow.com/questions/16168355/angularjs-server-side-validation-and-client-side-formsThere was a link in that discussion I planned to follow up but was very busy with other work. May be you have examples of how to do that part.
Thanks.
If it's not broken, fix it until it is.
My Blog