jeudi 4 août 2016

Can angular checkbox post a boolean with ng-model?

This code will post support_enable='true' when checked, or nothing when unchecked.

<form>
  <input type="checkbox" name="support_enable" ng-value="config.support_enable" ng-model="config.support_enable">
</form>

This code will post support_enabled='on' when checked, or nothing when unchecked.

<form>
  <input type="checkbox" name="support_enable" ng-model="config.support_enable">
</form>

I want to know is there a way to post a boolean value?




Aucun commentaire:

Enregistrer un commentaire