After I have changed a variable it doesn’t update the view, if I go to another view and then back again it updates. How can I update the view without reloading the page?
use $apply in this case .
Better would be to stay in the AngularJS digest cycle.
To fully refresh the page without reloading use the following script in your refresh action…
$scope.refresh = function()
{
$ionicHistory.clearCache([$state.current.name]).then(function()
{
$state.reload($state.current);
});
};
** as i understand your question may be it is best
in case if you want to do something before page loads use the following script in your page enter
$scope.$on("$ionicView.beforeEnter", function(event, data)
{
//your code here
});
How to do this .share some code.
We can only help you if you post your code. Do you do any http calls with jQuery or something?