I'm trying to redirect to other page on angular after posting data to API, I typed this code:
$scope.Proceed = function () {
DataService.InsertPerson($scope.p)
.then(function success(data) {
$scope.p.ID = data.data;
var url = "http://" + $window.location.host + "/#/show/person/";
$window.location.href = url + data.data; //adding ID to url
});
};
the page redirected correctly , But Angular Throws an error:
Error: $rootScope:infdig Infinite $digest Loop
I tryed $location but same results.
thank you for your time