Hi,
I’m trying to clear a form after submitting it. I’ve looked around and I’m trying with $setPristine in this way:
HTML:
< form name=“form.NewEvent” >…< /form >
JS (Controller):
$scope.form = {};
$scope.button = function(event){
Events.saveEvent(event, $scope.imgURI).then(function(){
$scope.form.NewEvent.$setPristine();
console.log(‘el $setPristine: ‘, $scope.form.NewEvent.$pristine);
$state.go(‘tab.dash’);
}, function(err) {
console.log(’ Error…’, err);
});
}
It looks like it works ($pristine logs as true) but when I get back to the form it still has the same content I submitted
Can anyone help me, please?