title: ng-model with bracket
body: <p>I was looking through a code and i ran across this line of code and couldn't figure it out. </p>
  
  <pre><code>&lt;table&gt;
      &lt;tr&gt;
          &lt;td align="right"&gt;Search :&lt;/td&gt;
          &lt;td&gt;&lt;input ng-model="query[queryBy]" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td align="right"&gt;Search By :&lt;/td&gt;
          &lt;td&gt;
              &lt;select ng-model="queryBy"&gt;
                  &lt;option value="name"&gt;NAME&lt;/option&gt;
                  &lt;option value="company"&gt;COMPANY&lt;/option&gt;
                  &lt;option value="designation"&gt;DESIGNATION&lt;/option&gt;
              &lt;/select&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;hr&gt;
  &lt;div&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;th&gt;Employee Name&lt;/th&gt;
              &lt;th&gt;Company Name&lt;/th&gt;
              &lt;th&gt;Designation&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr ng-repeat="emp in employees | filter:query"&gt;
              &lt;td&gt;{{emp.name}}&lt;/td&gt;
              &lt;td&gt;{{emp.company}}&lt;/td&gt;
              &lt;td&gt;{{emp.designation}}&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>What does the [queryBy] mean in query[queryBy] ?</p>
  
  <p>The JS: </p>
  
  <pre><code>$scope.query = {};
  $scope.queryBy = '';
  </code></pre>