I have a special function:
$scope.insert = function(){
var info = {
'username' : $scope.username,
'password' : $scope.password,
'full_name' : $scope.full_name
}
$http({
method: 'POST',
url: './sys/mac.php',
data : info
}).then(function(response){
return response.data;
});
}
The function is working perfectly, but I want the page to switch to datalist and automatically refresh after the insert() is successful. The insert() function is executed in the route "localhost/learn/#!/administrator" so I would like it to change to the route "localhost/learn/#!/" once insert() is successful. I tried using location.href='#!/' but it only changes the location without refreshing the datalist automatically.