Answer the question
In order to leave comments, you need to log in
Angular 1.x How to make $routeProvider ignore links with "#" stubs?
Dropdown menu issue from Bootstrap. When you click on the dropdown, the menu item joxi.ru/n2YkVqquo46Bzr triggers the rule otherwise
$locationProvider.hashPrefix('!');
$routeProvider.otherwise({redirectTo: '/main'});
href="#"
Answer the question
In order to leave comments, you need to log in
You need to listen to the $routeChangeStart event and cancel the action.
$rootScope.$on('$routeChangeStart', function(event, next, current) {
// добавьте здесь свою проверку на пустой hash и вызовите отмену
event.preventDefault();
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question