我有一个函数getEvent();.这个功能完成它所说的。现在我有一个函数duplicateEvent()。它也做了它所说的。我想从getEvent接收的范围中删除ID。因此,如果我在duplicateEvent()函数中使用$ scope.event.event.id = null,则不会使事件ID为null。
$scope.getEvent = function ( value )
{
eventFactory.getEvent(value)
.then(function ( response )
{
//Reset input field after a new getEvent Request
angular.element("input[type='file']").val(null);
$scope.event = response.data;
$scope.flyers = {
front: {
preview: $scope.event.event.flyer_front,
isNew: false,
},
back: {
preview: $scope.event.event.flyer_back,
isNew: false,
}
};
$('#form-date-start').datetimepicker({
value: $filter('formatDate')($scope.event.event.dates.raw.date_start, 'dd-MM-yyyy HH:mm')
});
$('#form-date-end').datetimepicker({
value: $filter('formatDate')($scope.event.event.dates.raw.date_end, 'dd-MM-yyyy HH:mm')
});
});
};
$scope.duplicateEvent = function ( id )
{
$scope.event.event.id = null;
};