title: Angular - two dropdowns with same datasource
body: <p>i am having two dropdowns with same issue. my Challenge is , whenever i select 1 , the other one also gets selected. Also, if there is a validation error, it throws only on one dropdown. What am i missing? </p>
  
  <pre><code> &lt;div class="form-group"&gt;
                      &lt;label for="ctctype_id"&gt;
                         Current CTC
                      &lt;/label&gt;
                      &lt;select class="form-control" name="ctctype_id" id="ctctype_id" data-ng-model="formJobApplyData.salary_range"
                              data-ng-options="salary.key for salary in salaryList" data-validate-selected-keyvalue&gt;&lt;/select&gt;
                  &lt;/div&gt;
  
                  &lt;div data-ng-messages="jobForm.ctctype_id.$error" data-ng-show="jobForm.ctctype_id.$invalid &amp;&amp; (jobForm.ctctype_id.$touched || jobForm.ctctype_id.$dirty)" class="form-message"&gt;
                      &lt;p data-ng-message="validselectedkeyvalue"&gt;
                          Please select your current CTC from the list
                      &lt;/p&gt;
                  &lt;/div&gt;
  
                  &lt;div class="form-group"&gt;
                      &lt;label for="exptype_id"&gt;
                         Expected CTC
                      &lt;/label&gt;
                      &lt;select class="form-control" name="expctc_id" id="expctc_id" data-ng-model="formJobApplyData.salary_range"
                              data-ng-options="salary.key for salary in salaryList" data-validate-selected-keyvalue&gt;&lt;/select&gt;
                  &lt;/div&gt;
  
                  &lt;div data-ng-messages="jobForm.expctc_id.$error" data-ng-show="jobForm.expctc_id.$invalid &amp;&amp; (jobForm.expctc_id.$touched || jobForm.expctc_id.$dirty)" class="form-message"&gt;
                      &lt;p data-ng-message="validselectedkeyvalue"&gt;
                          Please select your expected CTC from the list
                      &lt;/p&gt;
                  &lt;/div&gt;
  </code></pre>
  
  <p>My javascript Valiation :</p>
  
  <pre><code>app.directive('validateSelectedKeyvalue', function () {
      return {
          restrict: 'A',
          require: 'ngModel',
          link: function (scope, elem, attr, ctrl) {
              ctrl.$validators.validselectedkeyvalue = function (viewValue) {
                  if (typeof (viewValue) != 'undefined') {
                      return ((typeof (viewValue.id) != 'undefined') &amp;&amp; viewValue.id != 0) ? true : false;
                  }
                  else { return true; }
              }
          }
      };
  });
  </code></pre>