title: getting the id of countries returns Expression 'mid = s.id' is non-assignable
body: <p>I have this function that returns a scope called <strong>mid</strong> to hold the id of countries to be assigned to populate states select box. Here is the function and scope initialized </p>
  
  <pre><code>$scope.logId = function() {
          $scope.mid = 1;
          console.log($scope.mid);
          return ($scope.mid);
      };
  </code></pre>
  
  <p>I have a loop of countries that returns the id during the loop. On trying to assign the id of the country in select option to <strong>$scope mid</strong> to change the initial <strong>$scope.mid</strong> of the function <strong>$scope.logId</strong> so that when I call the get states function it will receive the current id of the function <strong>$scope.logId</strong> I get this error</p>
  
  <pre><code>Expression 'mid = s.id' is non-assignable. Element: &lt;option ng-repeat="s in countries" ng-model="mid = s.id" value="{{s.name}}" class="ng-pristine ng-untouched ng-valid ng-binding ng-scope"&gt;
  </code></pre>
  
  <p>Here is the loop of the country where I am making the loop and assignment</p>
  
  <pre><code>&lt;option ng-repeat="s in countries" ng-model="mid = s.id" value="{{s.name}}"&gt;{{s.name}}&lt;/option&gt;
  </code></pre>
  
  <p><strong>EDITTED TO SHOW COMPLETE CODES</strong></p>
  
  <pre><code>&lt;select ng-click="getCountries()" formcontrol name="country" class="ng-untouched ng-pristine ng-valid" required&gt;
  
  
  
          &lt;option ng-repeat="s in countries" ng-click="mid = s.id" value="{{s.name}}"&gt;{{s.name}}&lt;/option&gt;
  
          &lt;/select&gt;
  
  
      &lt;/div&gt;
  
      &lt;div ng-class = "{'has-error':frmValidation.state.$invalid &amp;&amp; !frmValidation.state.$pristine}" class="field required"&gt;
        &lt;label&gt;State&lt;/label&gt;
        &lt;select ng-click="getStates(mid)" ng-model="reg.state" formcontrol name="state" class="ng-untouched ng-pristine ng-invalid" required &gt;
  
          &lt;option ng-repeat="s in states" value="{{s.name}}"&gt;{{s.name}}&lt;/option&gt;
        &lt;/select&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Please assist to get the value of the <strong>select option id</strong> to be assigned to <strong>scope mid</strong> and received from <strong>logId</strong> function, so that whenever <strong>ng-click is called on logId</strong> it returns the current id of the selected country</p>