Skip to content

Instantly share code, notes, and snippets.

@ADmad
Created September 9, 2014 08:17
Show Gist options
  • Save ADmad/db758a8a287a829e4aad to your computer and use it in GitHub Desktop.
Save ADmad/db758a8a287a829e4aad to your computer and use it in GitHub Desktop.
Clear sticky state locals.
diff --git a/src/stickyStateProvider.js b/src/stickyStateProvider.js
index 800c16a..1d89f09 100644
--- a/src/stickyStateProvider.js
+++ b/src/stickyStateProvider.js
@@ -109,6 +109,16 @@ function $StickyStateProvider($stateProvider) {
});
return states;
},
+ clearInactiveState: function (name) {
+ var state = inactiveStates[name];
+ if (!state) {
+ return false;
+ }
+ state.locals = null;
+ delete state.self.status;
+ delete inactiveStates[name];
+ return true;
+ },
getInactiveStatesByParent: function () {
return mapInactives();
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment