e
template. This allows for generic collection of messages to be reused across multiple parts of an
application.</p>
<pre><code class="lang-html">&lt;script type=&quot;text/ng-template&quot; id=&quot;error-messages&quot;&gt;
  &lt;div ng-message=&quot;required&quot;&gt;This field is required&lt;/div&gt;
  &lt;div ng-message=&quot;minlength&quot;&gt;This field is too short&lt;/div&gt;
&lt;/script&gt;

&lt;div ng-messages=&quot;myForm.myField.$error&quot; role=&quot;alert&quot;&gt;
  &lt;div ng-messages-inclu