[英]Angularjs re-render the whole page [ionic]
我有一个角度方法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});
或者,如果仅使用角度路线,请使用以下路线
$route.reload()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.