i\'m developing an application in AngularJS. Basically, i have a \"home\" page and a \"new project\". In the home page i have a menu with a link to \"new project\".
Use this in your controller of 'newproject' it is listening your refresh:
$rootScope.$on('$locationChangeStart', function(event) {
$state.go('home');
});
or put this in app.run();
$rootScope.$on("$locationChangeStart", function(event, next, current) {
if(next==current && next=='/newproject')
$state.go('home');
});