I wonder, why not working when input has default value assign to controller and when you post this input undefined in the server side. However, when you type directly to input its working and got the value. What is the difference why assigning a default value undefined when you post to the server side.
<input type="text" id="defval" name="defval" ng-value="myvar" ng-model="Data.defval">
Controller
app.controller('RoomContrroller', function($scope, $http){
$scope.myvar=1;
$scope.SaveRecord = function (msg) {
$scope.loaderForm=true;
var formdata = $scope.Data;
$http.post("Add.php", formdata)
.then(function(response){
console.log(response.data);
if(response.data==0){
$scope.fetch();
$scope.$emit('swalSuccess', { message: msg });
}else{
$scope.$emit('swalError', { message: msg });
}
$scope.loaderForm=false;
});
}
}