For my authentication service, I am trying to send a Post request to a php file in order to load the home page partial on my ng-view
upon successful authentication.
This is the code snippet I have attempted:
function loginCtrl($scope, $http, $location){
$http.post(url,data).success(function(data){
$location.path('/home');
});
}
The issue lies in the fact that even though the URL changes, the ng-view
does not update. It only updates when I manually refresh the page.
I have properly configured routes using the $routeProvider
and tested redirecting with a standalone function outside of the callback function, which worked successfully.
In an attempt to resolve this issue, I also tried defining $location.path('/home')
as a function and then calling it within the callback, but still faced the same problem.
Upon researching, I came across articles suggesting that such issues may arise when using third-party plugins. However, in my case, I am only loading angular.js.
If anyone has any insights or can point me towards relevant study material, it would be greatly appreciated.