title: AngularJS - How to access a binding value within ng-switch
body: <p>Within a ng-repeat I have a ng-switch conditional. I want the value of the ng-switch argument to be a binding. However the curly-bracket binding doesn't seem to be converted into the expected generated value. I'm aware that ng-switch creates a new scope, and that is surely causing the problem. I know about a <a href="https://stackoverflow.com/questions/15593299/angularjs-ng-switch-does-not-bind-ng-model">'dot' work-around</a> but as the values here are coming from a service via a controller query, I can't figure out how to implement it in this situation.</p>
  
  <p><strong>html</strong></p>
  
  <pre><code>&lt;tr ng-repeat="user in users"&gt;
      &lt;td ng-switch on="editState"&gt;&lt;p ng-switch-when="noEdit"&gt;{{user.username}}&lt;/p&gt;&lt;input type="text" value="{{user.username}}" ng-switch-when="{{user.username}}"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p><strong>controller.js</strong></p>
  
  <pre><code>$scope.users = Users.query();
  </code></pre>
  
  <p>-edit-</p>
  
  <p>this is the function that triggers the switch</p>
  
  <pre><code>$scope.editUser = function(usernameEdit) {
      $scope.editState = usernameEdit;
  };
  </code></pre>