0

I have an angular method deleteConfirm:

$scope.deleteConfirm = function(pageIndex) {
    var confirmPopup = $ionicPopup.confirm({
        title: 'Delete Page',
        template: 'Are you sure you want to delete this page?'
    });
    confirmPopup.then(function(res) {
        if(res) {
            var permanentStorage = window.localStorage;
            var noteBooks = JSON.parse(permanentStorage["noteBooks"]);
            noteBooks[noteBookIndex].pages.splice(pageIndex, 1);
            permanentStorage["noteBooks"] = JSON.stringify(noteBooks);
        }
    });
};

I want to re-render the whole page after calling this function. I tried the reload() method but it didn't work for me.

Kash Pourdeilami
  • 488
  • 2
  • 6
  • 24

1 Answers1

2

You could user following if you are using UI-Router on Ionic

        $state.go($state.current, {}, {reload: true});

Or If you are using only Angular Routes, Use follwoing

        $route.reload()
vs4vijay
  • 1,175
  • 3
  • 14
  • 28