I had a project where the url just worked fine when working locally by going to
localhost: 9000 /
Url will become
http: // localhost: 9000 / # /
For some changes, I did it now to
http: // localhost: 9000 / #! / (with an exclamation mark)
In addition, other URLs are becoming weird. if I try to click a link, for example, go to the toolbar. It does not appeal to me. Instead, it makes the URL as
/ #! / #% 2Fdashboard
and after that nothing happens. What have I done wrong and how can I solve this? I canβt show the code because I donβt know where I was wrong. I completed the following tutorial and after that there was a problem. Perhaps there is a mistake?
tutorial link
I added my .config where I installed the routes.
.config(function ($routeProvider, $httpProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl',
controllerAs: 'vm',
activetab: 'main'
})
.when('/about', {
templateUrl: 'views/about.html',
controller: 'AboutCtrl',
controllerAs: 'vm',
activetab: 'about'
})
.when('/faq', {
templateUrl: 'views/faq.html',
controller: 'FaqCtrl',
controllerAs: 'vm',
activetab: 'faq'
})
.when('/dashboard', {
templateUrl: 'views/dashboard.html',
controller: 'DashboardCtrl',
controllerAs: 'vm',
activetab: 'dashboard'
})
.when('/logout', {
templateUrl: 'views/main.html',
controller: 'LogoutCtrl',
controllerAs: 'vm'
})
.otherwise({
redirectTo: '/'
});
$httpProvider.interceptors.push(['$q', '$window', '$localStorage', function($q, $window, $localStorage) {
return {
'request': function (config) {
config.headers = config.headers || {};
if ($localStorage.globals) {
config.headers.access_token = $localStorage.globals.currentUser.token;
}
return config;
},
'responseError': function(response) {
switch(response.status) {
case 403:
break;
case 404:
break;
case 500:
$window.location = './500.html';
break;
}
return $q.reject(response);
}
};
}]);