v&gt;
</code></pre>
<p>Feel free to use other structural directives such as ng-if and ng-switch to further control
what messages are active and when. Be careful, if you place ng-message on the same element
as these structural directives, Angular may not be able to determine if a message is active
or not. Therefore it is best to place the ng-message on a child element of the structural
directive.</p>
<pre><code class="lang-html">&lt;div ng-messages=&quot;myForm.myEmail.$error&quot; role=&quot;alert&quot;&gt;