I have a button that both fires a function and redirects. Is it possible to stall the redirect until the function returns?
The reason I want to do this is because I have a second function on the destination page that uses variables set by the first function as parameters, right now the redirect happens before the first function has time to set the variables used as parameters in the second function.
My button
<button class="btn btn-sm btn-primary" ng-click="selectCharacter(character)" ui-sref="apply" ng-show="application">
Select
</button>
html-tag calling second function with ng-init, using parameters set by the first function
<form ng-Submit="getCharacterInfo(apply)" ng-init="getCharInfo(current_user, current_user_realm)">