title: Set conditions while using uib-popover
body: <p>I'm trying to implement a registration form by using AngularJS. The form must prompt user for incorrect input while attempting submission.</p>
  
  <p>I used <code>uib-popover</code> provided by UI Bootstrap to implement the popover function while clicking "save" button. Here is what I've done so far for the click button on the web page:</p>
  
  <pre><code>&lt;button class="btn btn-primary" type="button" uib-popover = 
  "Wrong email format: {{formDetail.email_test}}" popover-title=
  "{{errorMsgPopover.title}}" style="height:30px; padding:4px 12px;"
  ng-click="beforeAndAfterDemo()"&gt;Save&lt;/button&gt;
  </code></pre>
  
  <p>Now I can successully retrieve the data I want from the controller. It looks like the following:</p>
  
  <p><a href="https://i.stack.imgur.com/2Iptl.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2Iptl.jpg" alt="enter image description here"></a></p>
  
  <p>However, what I wish to do is to implement <em>form validation</em>, and the popover should only be shown when given input is not correct.</p>
  
  <p>Could you show me how to implement <strong>conditional</strong> <code>uib-popover</code>? Assume I already have some logic implement by JavaScript and I have put them all inside the controller.</p>
  
  <p>Thank you.</p>