I'm currently using this in my controller right now: (new to angular don't beat me)
app.controller('userLogin', ['$scope', '$http', '$location', '$route', function ($scope, $http, $location, $route) {
activeLink = 'userLogin';
$scope.submitForm = function(valid) {
if (valid) {
$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded";
$http.post('/user/login', $('#userLoginForm').serialize())
.success(function(data) {
$route.reload();
});
}
}
}]);
Which works fine, when I reload the page the navbar login/create links disappear and is replaced with logout and what not, but my problem is the navbar doesn't reload unless I manually hit CTRL+R
I've tried using $location.path('/'); and $route.reload(); but my navbar doesn't change still unless I manually reload the page.