title: Working with a form inside an Angular UI Bootstrap popover?
body: <p>I have a button that pops up an Angular UI Bootstrap popover, using a template.</p>
  
  <p>You can view it in <a href="https://codepen.io/smlombardi/pen/pbaoRr" rel="nofollow">this pen</a></p>
  
  <p>The popover template is a form with a table containing a series of text fields with ng-models: </p>
  
  <pre><code>&lt;script type="text/ng-template" id="filterPopoverTemplate.html"&gt;
  &lt;div class="filters"&gt;
    &lt;form&gt;
      &lt;table&gt;
        &lt;tbody&gt;
          &lt;tr&gt;
            &lt;td&gt;&lt;input type="text" size="5" ng-model="filterHsCodeRestricted"&gt;&lt;/td&gt;
            &lt;td&gt;HS Code Restricted&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td&gt;&lt;input type="text" size="5" ng-model="filterHsCode10"&gt;&lt;/td&gt;
            &lt;td&gt;HS Code 10&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td&gt;&lt;input type="text" size="5" ng-model="filterCOD"&gt;&lt;/td&gt;
            &lt;td&gt;COD&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
      &lt;div class="filter-buttons"&gt;
        &lt;button tabindex="0" class="btn btn-default btn-xs" ng-click="applyFilters()"&gt;Apply&lt;/button&gt;
        &lt;button class="btn btn-default btn-xs" ng-click="resetFilters()"&gt;Reset&lt;/button&gt;
      &lt;/div&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>I have a "reset" button which calls a function that I want to reset all the ng-models to empty strings:</p>
  
  <pre><code>   $scope.resetFilters = function () {
      $scope.filterHsCodeRestricted = '';
      $scope.filterHsCode10 = '';
      $scope.filterCOD = '';
    };
  </code></pre>
  
  <p>However, if I type something into the field and click "reset", the model is not being set to the empty string.  I've done this elsewhere and it works, just not inside a popover template, so I assume it has something to do with the fields being in a popover ng-template. How do I "access" those?</p>