I have the following input which is a toggle returns true , false
<input id="{{event.id}}" ng-model="event.is_active" type="checkbox" value="true" class="block__input" ng-class="{'input__toggle--active' : event.is_active}">
and when I send it like this
var formData = new FormData();
console.log(scope.event.is_active);
formData.append('is_active', scope.event.is_active);
In the server I receive false and true as strings 'true', 'false'
How to solve this problem ?
See Question&Answers more detail:os