In Angular, how do I redirect to a different page? With all the examples I've found, it only redirects to a relative URL, i.e. my currentURL+'#/new_newPath'.
Here is my code:
function mainController($scope, $http, $location) {
// when submitting the add form, send the text to the node API
$scope.createProperty = function() {
$http.post('/api/property', $scope.formData)
.success(function(data){
$location.path( '/profile' );
})
.error(function(data){
});
};
}
I am originally at localhost/new_prop and i want to go to localhost/profile. Also, my angular app is located at localhost/new_property. if i go to localhost, i am not accessing my angular app. localhost/profile is also not part of the angular app
This seems like it should be really straightforward....