Created
November 20, 2013 17:18
-
-
Save tastywheat/7567121 to your computer and use it in GitHub Desktop.
ui router reloadOnSearch workaround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.run(function($rootScope){ | |
// register listener to watch route changes | |
$rootScope.$on( "$stateChangeStart", function(event, toState, toParams, fromState, fromParams) { | |
if ( fromState.name === "watch" && fromState.name === toState.name) { | |
//do nothing, prevent page reload | |
event.preventDefault(); | |
} | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment