Hide Ionic model and change state


#1

$scope.userActionModal.hide();
$state.go(‘app.addexpense’,{},{reload: true});

This is the code i’m using for hiding the model and go to a new state.but when i tested in ipad the model goes down but not hiding until the state changes.


#2

the hide-method returns a promise so you can wait to change the state until the modal is closed (animation has finished):

$scope.userActionModal.hide().then(function () {
  $state.go('app.addexpense',{},{reload: true});
});