vendredi 23 octobre 2015

angular material checkbox

I have a use case where I submit a form which in turn does a $http.get(). The get url accepts paramter say: &code ='P' &code='C'. Where P and C are to be selected from checkbox and passed to this parameter "code".

I am using angular material checkbox, but everytime I submit the form "code" parameter is getting set to true instead of P or C.

  $scope.putCall = {};
  $scope.putCall.p = 'P';
  $scope.putCall.c = 'C';

  <md-checkbox ng-model="putCall.p" aria-label="P" name="P_put_call_code">
   P: {{ putCall.p }}
  </md-checkbox>
  <md-checkbox ng-model="putCall.c" aria-label="C">
   C: {{ putCall.c }}
   </md-checkbox>

How do I pass "P" instead of true.




Aucun commentaire:

Enregistrer un commentaire