I trying to move from an activity to an other using Ionic. I dont have any error but the action does not work.
My state is :
.config(function ($stateProvider) { $stateProvider .state('index', { templateUrl: 'index.html', url: '/' }) .state('home', { templateUrl: 'templates/welcome.html', url: '/home' }); })
My controller is :
.controller('HomeCtrl', function($scope, $state, $http, $location) {
$scope.login = function(user) {
$http.get("http://localhost/app_dev.php/json/login/"+user.username+"/"+user.password)
.then(function(response){
console.log(response.data.status);
if(response.data.status === 200)
{
alert("redirect to main page");
$location.path("/home");
}else if(response.data.status === 403){
alert("Login or password incorrect");
}else{
alert("User not found");
}
});
};
})
When i receve my Json, I do not have error but the redirection does not show