I am attempting to make a simple authentication service by sending a Post to a php file, I need it to load the home page partial on my ng-view
when its successful.
This is what I tried :
function loginCtrl($scope, $http, $location){
$http.post(url,data).success(function(data){
$location.path('/home');
});
}
Results in my url changing but ng-view
not updating. It updates when I manually refresh the page.
(routes have been configured properly at the $routeProvider
, I have tested redirecting this with a standalone function not as a callback and it works )
I have also tried defining $location.path('/home')
as a function and then calling it on the callback it still doesn't work.
I did some research and found some articles stating this happens when using another third party plugin, I am only loading angular.js
Any insights or pointers to some study material will be great
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…