I'm facing an issue with passing the selected radio button data to the scope and then submitting it to the server. Despite my efforts, the data is not being transmitted. Below is my HTML code snippet:
<div class="form-group">
<label class="control-label"> What product?</label>
<div ng-repeat="type in typeProducts | orderBy:'name'">
<input type="radio" ng-model="$parent.product_id" name="typeproduct" value="{{type.id}}"/>
<label for="radio">{{type.name}}</label>
</div>
</div>
Here's a glimpse of the corresponding controller:
$scope.createProduct = function() {
Account.createProduct($scope.product)
.then(function() {
toastr.success('Product has been created');
})
.catch(function(response) {
toastr.error(response.data.message, response.status);
});
};
The root cause seems to be on the server end as the database isn't accepting null values in certain columns.