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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -