Answer the question
In order to leave comments, you need to log in
Angular: Explain why URL is lost on page reload?
I made Angular without "#" and "#!", but for some reason, during a normal (to Ajax) transition to the page or update, the URL is lost (It gets back to the main one). I can't understand it...
After all, vk.com doesn't lose its url when the page is reloaded.
With tags "#" and "#!" it didn't happen.
Firefox 35 Linux Gentoo
app.config(function($routeProvider, $locationProvider){
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix('!');
$routeProvider.when('/',{
templateUrl:"partials/list.html",
controller:"SiteCtrl"
})
.when('/article/:article', {
templateUrl:"partials/post.html",
controller:"SiteCtrl"
})
.when('/category/:category', {
templateUrl:"partials/category_post.html",
controller:"SiteCtrl"
})
.when('/event-category/:category', {
templateUrl:"partials/category_event.html",
controller:"SiteCtrl"
})
.when('/event/:event', {
templateUrl:"partials/event.html",
controller:"SiteCtrl"
})
.when('/events', {
templateUrl:"partials/events.html",
controller:"SiteCtrl"
})
.when('/pictures',{
templateUrl:"partials/pictures.html",
controller:"SiteCtrl"
})
.when('/calendar',{
templateUrl:"partials/calendar.html",
controller:"SiteCtrl"
})
.when('/page/:slug', {
templateUrl:"partials/page.html",
controller:"SiteCtrl"
})
.otherwise({
redirectTo:'/'
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question