I found that modality rejection is best used if it belongs to the user closing the modal (for example, returning to the state behind the modal and calling state.go ('^')), and modal closing is used when changing state through $ state.go or ui-sref.
That way you can use the promise of result to do different things, depending on what happens.
result.then(function() { /* state change via ui-sref */ })
result.catch(function() { /* user closed modal */ })
AnthW Apr 24 '17 at 14:18 2017-04-24 14:18
source share