title: AngularJS Filter based on radio selection
body: <p>I am implementing a search input box that should search based off of a certain property of the objects that are getting iterated over and I would like them to be selected using a radio button.</p>
  
  <p>For example here is my code:</p>
  
  <pre><code>&lt;span style="margin-bottom: 10px; display: inline-block;"&gt;Search: &lt;input ng-model="searchText.CustomerName" /&gt; &lt;/span&gt; 
  
      &lt;table id="Table1" class="alertTable"&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th class="xsmCol"&gt;&lt;img src="/App_Themes/SkyKick/images/misc/clear.gif" class="iFlag" /&gt;&lt;/th&gt;
                  &lt;th&gt;Subject&lt;/th&gt;
                  &lt;th&gt;Customer&lt;/th&gt;
                  &lt;th&gt;Type&lt;/th&gt;
                  &lt;th&gt;Date&lt;/th&gt;
                  &lt;th class="smCol"&gt;Actions&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody id="tbAlerts"&gt;
              &lt;tr ng-repeat-start="alert in alerts | filter:searchText"  &gt; &lt;!-- | filter:searchText --&gt;
                  &lt;td&gt;&lt;img src="/App_Themes/SkyKick/images/misc/clear.gif" data-tooltip="{{ alert.tooltip }}" class="{{ 'iAlert' + alert.AlertType }}"/&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;a href="Show Alert Details" ng-click="showAlertDetails($event)"&gt;{{ alert.Summary }}&lt;/a&gt;&lt;/td&gt;
                  &lt;td&gt;{{ alert.CustomerName }}&lt;/td&gt;
                  &lt;td&gt;{{ alert.CreatedDate }}&lt;/td&gt;
                  &lt;td&gt;{{ alert.Category }}&lt;/td&gt;
                  &lt;td&gt;
                      &lt;!-- Tricky little widget logic --&gt;
  
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr ng-repeat-end class="alertDetail"&gt;
                  &lt;td&gt;&lt;/td&gt;
                  &lt;td colspan="5" ng-bind-html="alert.Details"&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>As you can see, I am currently filtering based off of the CustomerName field in my array. However, I want to change the logic so that I can select between CustomerName, Subject, Type, and Date using a radio button. So if the user clicks the Date radio button, then the searchText will filter only based off the Date attribute. What is the best way to get this functionality?</p>