<div class="row" ng-switch on="patienttype">
<hr>
<div class="col-lg-4">
<div class="panel-body" ng-switch-when="Outpatient">
<div class="form-group">
<label>Attending Physician</label>
<input type="text" placeholder="Dr. Juan Dela Cruz" ng-model="attendingdoctor">
</div>
</div>
</div>
</div>
I'm trying to do an angularjs post but the input data doesn't bind to the model when doing the post. Here's the code for the controller
$scope.Register = function() {
$http.post("http://localhost/Metro Lipa Patient System/metro-lipa-pages/patient-details.php", {
'attendingdoctor': $scope.attendingdoctor
}).then(function(response){
window.location.href = 'index.php'
});
};
What could be the thing that I'm doing wrong?
This is php script after posting the data
<?php
require_once '../assets/connection.php';
$postdata = file_get_contents("php://input");
$request = json_decode($postdata);
$attendingdoctor = addslashes($request->attendingdoctor);
?>