00:00 With ng-messages, you can reuse and override ng-messages. We're going to see how you do that here. I have a simple demo input field that's of type email and it's required and it has minimum length.
00:13 We say, "hello@Gmail.com." We have ng-messages multiple. I prefer it to only have one at a time, now, we say, "Hello" and one at a time here.
00:27 We're going to take these messages and we're going to extract them out into their own template so that they can be reused by multiple fields. Because if I wanted to reuse this same thing again, don't you dare copy paste.
00:44 Now, you've got duplicate code. It's just a big mess. It's actually a lot easier to reuse these messages. I'm going to create a script tag down here, type="text/ng-template."
00:58 ID is my-messages. Then, we'll take these messages from up here. We'll stick them in there. Then, it's just ng-messages-include="my-messages." There you go. Everything's working, just as well.
01:16 It's all working out as expected as it was before. That's how easy it is to abstract and share. Now, if I wanted to redo this I do need to copy a little bit, but not nearly as much. And so, it's almost bearable, but it sure looks ugly.