1

I am trying to do reload of current state for my ionic program and my code looks something like this:

angular.controller('myController', function($ionicPopup,$state,$stateParams){
    console.log("myController");
    $ionicPopup.confirm({
            title: "Alert",
            template: "Want to reload?",
            cancelText: "Cancel",
            okText: "Reload",
            okType: 'button-assertive'
        }).then(function(res){
            if( res ){
                $state.transitionTo($state.current, $stateParams, {
                    reload: true,
                    inherit: false,
                    notify: true
                });
            }
        });
});

I am doing the reload by reference to the answer from Reloading current state - refresh data.

It does reload as I see a "flash" on the screen. However, why is that I don't see console log output and ionic popup after reload? How can I get everything re-executes after reload?

Community
  • 1
  • 1
user1995781
  • 19,085
  • 45
  • 135
  • 236

1 Answers1

0

I think this would be best approach

<a data-ui-sref="directory.organisations.details" data-ui-sref-opts="{reload: true}">Details State</a>

We can reload the state from the HTML only.

Priyank_Vadi
  • 1,028
  • 10
  • 27