有没有办法在表单提交时传递输入字段的绝对值?
<form method="POST" enctype="multipart/form-data" ng-submit="vm.saveInfo($event)">
<input type="text" ng-model="vm.hotel.numberOfGuests">
<input type="text" ng-model="vm.hotel.emptyRooms">
</form>
或者我需要操纵控制器内的那些,如下所示
vm.hotel.numberOfGuests = Math.abs(vm.hotel.numberOfGuests)
vm.hotel.emptyRooms = Math.abs(vm.hotel.emptyRooms)