Redirect to a different page after POST using AngularJS -
after searching , not coming solution posting code snippet help.
$scope.createaddress = function () { $http({ method: 'post', url: '/addressbook/api/person', data: $scope.person, headers: { 'content-type': 'application/json; charset=utf-8' } }).success(function (data) { $location.path('/addressbook'); }); }
after posting redirect different page. $location.path not accomplishing this. have tried $scope.apply() others have had success that. missing or not understanding $location used for? code being hit.
there should listening on path change, $routeprovider
. case?
if need full page reload other (server-side) route might try $window.location.href
.
Comments
Post a Comment