Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. var previous = null, lastPrevious = null, memos = {};
  2. $rootScope.$on("$transitionStart", function(evt, $transition$) {
  3. lastPrevious = previous;
  4. previous = $transition$.from;
  5.  
  6. $transition$.promise.then(commit).catch(revert);
  7. function commit() { lastPrevious = null; }
  8. function revert() { previous = lastPrevious; }
  9. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement