Ionic View keeps caching previous mobile number on iOS


#1

First, i apologize for the code here. Its just to give a rough understanding of the flow for this issue

 <label class="item item-input item-border-bottom">
 	<input type="text" name="applicant_name" class="ng-pristine ng-invalid ng-invalid-required" ng-model="user.applicant_name" placeholder="Full Name *" required>
 </label>
 <label class="item item-input item-border-bottom">
       <input type="text" name="phone_number" ng-model="user.phone_number" class="form-control ng-invalid-pattern ng-dirty ng-valid ng-valid-required  ng-valid-maxlength ng-valid-minlength " placeholder="Phone Number *" required ng-pattern="/[+ ]?[0-9]{2,4}[- ]?[0-9]{3,4} ?[0-9]{4,5}$/" minlength="10" maxlength="15">
  </label>

$scope.submitData = function() {
$scope.$applyAsync(function() {
referralCasesGroupByCaseStatus.getListing(usernameWeb).then(function(data){
$rootScope.listingDetails = data;
});
})
$scope.$applyAsync(function() {
$ionicLoading.hide();
$ionicPopup.show({
title: ’ Submission Confirmation!’,
scope: $scope,
template:’ Congratulations Your Application Has Been Submitted. Case ID: '+ case_details.case_code,
buttons: [
{
text: ’ View Case ',
type: ‘button-positive’,
onTap: function(e) {
referralCasesGroupByCaseStatus.getSingleCase(case_details).then(function(status) {
$rootScope.type_of_service = status.type_of_service;
$sessionStorage.type_of_service = $rootScope.type_of_service;
$rootScope.newCaseSubmitted = true;
$state.go(‘app.case_status_single’)
})
}
}
]
});
})
}

display.html 
 <ion-content ng-controller="referralCtrl">
 	<div class="row">
            <div class="col">
              <h3>Mobile Number:</h3>
            </div>
            <div class="col col-text">{{detailedCaseInfo.contact_number}}</div>
          </div>
</ion-content>`

this is just snippets of my code. Basically i fill in all details in the form on new_submission.html. I submit all details nd save to db in submitData(), it shows an ionicPopup nd when Popup is clicked, it shows the display page.

The problem is all variables show properly but the phone number always shows the previous phone number and the recent phone number even though in the db all is saved correctly. But in the view, it is being repeated or cached. happens only on ios.


#2

Hi, i had the same problem, i fixed it with this code :

$ionicHistory.clearCache().then(function(){ $state.go('app.fooState'})