gpt4 book ai didi

javascript - Angularjs 重新渲染整个页面 [ionic]

转载 作者:行者123 更新时间:2023-12-02 17:14:27 25 4
gpt4 key购买 nike

我有一个 Angular 方法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);
}
});
};

我想在调用此函数后重新渲染整个页面。我尝试了 reload() 方法,但它对我不起作用。

最佳答案

如果您在 Ionic 上使用 UI-Router,您可以关注用户

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

或者,如果您仅使用 Angular Routes,请使用以下

        $route.reload()

关于javascript - Angularjs 重新渲染整个页面 [ionic],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24559219/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com