Thursday, February 5, 2015

Angular.js: re-use your validation messages

One really handy trick with Angular's ng-messages module is the ability to re-use messages. Instead of specifying the list with possible validation messages over and over again for every form field, just create one HTML template and load that:

In case you don’t want a generic validation message or want to add extra validation messages, this remains possible as well:

No comments: