As a newcomer to Angular, I am uncertain if this is the most effective solution. Within my state/route, there is a button that triggers the following function when clicked:
_this.foo = function () {
save();
$state.go("next");
}
The issue arises when reaching the next state with the same controller as the ongoing function continues to save the next page. This behavior is not desired; I intend for it to save the first page, proceed to the next one, and then stop.
Edit: I have multiple forms in a list, each form featuring an approval and disapproval button. Upon calling the save() function, all forms within the list are approved and saved to the back-end. However, the app persists in saving the subsequent list of forms as well after redirecting to the next page.
Is there a way to pass a parameter to the $state.go method in order to halt the function? I am unsure why this continuous saving behavior is occurring.