title: Modal search filter doesn't clear the ng-repeat list, Previous results persists
body: <p>I have a modal like below, which shows a list of items and a text field which filters the items in the list 'tmc.userMacrosListFiltered' according to the value in 'tmc.macrofilterpattern'.</p>
  
  <pre><code>&lt;div id="listmodal" class="modal fade" role="dialog"&gt;
      &lt;div class="modal-dialog" style="width: 350px;"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;
                      &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;
                  &lt;/button&gt;
              &lt;/div&gt;
              &lt;div class="modal-body" style=" height: 400px; width: 350px;overflow:scroll;"&gt;
                      &lt;div id="macrolist" class="list-group" tabindex="0" &gt;
                          &lt;input type="text" id="filterby" class="form-control list-group-item" autocomplete="off" placeholder="type macro title here.." ng-model="tmc.macrofilterpattern" /&gt;
                          &lt;a href="" class="list-group-item " ng-click="tmc.selectedMacro(item.macroTitle)" 
                          ng-repeat="item in tmc.userMacrosListFiltered" ng-if="item.macroTitle.toLowerCase().includes(tmc.macrofilterpattern.toLowerCase())"&gt;
                              {{item.macroTitle}}
                          &lt;/a&gt;
                      &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>When I close the modal, and I would like to clear the list and filter text. I am clearing it as below,</p>
  
  <pre><code>$('#listmodal').on('hidden.bs.modal', function(){
      $('#macrolist').find('.active').removeClass('active');
      tmc.macrofilterpattern = "";
      tmc.userMacrosListFiltered = {};
  });
  </code></pre>
  
  <p>On a given trigger to open the modal, I am filling up the tmc.userMacrosListFiltered list with latest values and suppose to be shown as list of items on the modal. The list is being updated with latest values however, the modal shows previous values for sometime (5-10 seconds)
  and refreshes with the latest values in 'tmc.userMacrosListFiltered'.</p>