I have TWO functions.
One hides a modal when the 'close' button is clicked The other function swipes right and changes the modal to another state/view.
I am having an issue with the modal NOT 'hiding' when the user swipes to the new state. I can see that it works but the modal remains on display and I was thinking that the best way to approach this is by chaining my two functions? Is this the correct terminology?
The TWO functions..
HIDES the modal
$scope.closetripInfo = function() {
$scope.modal.hide();
};
SWIPES right to reveal new .state
$scope.onSwipeRight = function() {
$state.go('app.current-trip');
}
This worked! BUT..
What I was thinking of doing is plugging in my exciting closetripInfo function into the onSwipeRight Like so:
$scope.onSwipeRight = function() {
$scope.closetripInfo();
$state.go('app.current-trip').closetripInfo();
}
It works BUT it does not look right to me and I am getting an error.. I haven't been successful on doing it correctly. Perhaps is not that simple. I also think that I might need to be aware of best practices like promises?
THE ERROR
TypeError: $state.go(...).closetripInfo is not a function at Scope.$scope.onSwipeRight
Any advice or resources would be greatly appreciated.Thank you!