I am trying to update record by angular post, below is code:
$.post(url, data, function (result) {
var error = false;
if (result.success == 1 && (result.entry_id) != false) {
//alert('Saved Successfully!!')
} else {
error = true;
}
$scope.$apply(function () {
$scope.loading = false;
if (error) {
$scope.error = true;
$scope.ErrorMessage = 'Internal server error occured.';
} else {
$scope.success = true;
window.location.href = "#/trVenueDetail/" + result.entry_id
}
});
});
But it's always made the new entry. Page URL is some thing like below:
http://example.com/new#/trAddVenue/47452
47452 is entry_id, I have tried to set it in hidden field:
The entry_id hidden field is automatically created by form tag.
{exp:channel:form channel="venues" include_jquery="no" json="yes"
id="addVenu" name="addVenu" }
-- Controls Html Is Here---
{/exp:channel:form}
The Same code is working in case of add new record, but how to update existing.
And yes I am able to populate the value.