When retrieving details of a specific item by passing URL parameters stored in local storage, I encountered an issue. I need to delete the local storage variables after the view is loaded. However, what actually happens is that the local storage variables are deleted before the view finishes loading, causing the data not to load correctly.
$scope.pushpayment_id = localStorage.getItem("pushpayment_id")
$scope.pushshop_id = localStorage.getItem("pushshop_id")
$scope.pushmessage = localStorage.getItem("push_message")
var startapp=function() {
if($scope.pushmessage == "payment"){
$location.path('/tab/new_payment_push/' + $scope.pushpayment_id + '/' + $scope.pushshop_id);
}
}
localStorage.removeItem("pushpayment_id")
localStorage.removeItem("pushshop_id")
localStorage.removeItem("push_message")