|
我有一个A.html,这个页面会从数据库中select 一些数据 展现出来 【读取数据是在A页面的controller中完成的】
我在A.html中 打开了一个 $ionicModal 页面 【$scope.modal.show();】 然后我在这个modal里面更新了 数据库中的数据,
当我关闭这个modal的时候 【$scope.modal.hide();】 回到了 A.html中,我怎么能在关闭modal时刷新这个A.html,也就是让他重新从数据库中读取数据
我在网上看到 在隐藏的事件上可以添加动作,但是并不好用呢,我该怎么处理?
$scope.$on('modal.hide', function() {
//隐藏执行动作
});--------------------------------------
例如:
$ionicModal.fromTemplateUrl('templates/Add-modal.html', {
scope: $scope,
animation: 'slide-in-up'
}).then(function(modal) {
$scope.modal = modal
})
$scope.openModal = function() {
$scope.modal.show();
}
$scope.closeModal = function() {
$scope.modal.hide();
};
$scope.$on('modal.hide', function() {
//想在这里让Add-modal.html刷新,重新提取数据,但是不好用 });
$scope.$on('$destroy', function() {
$scope.modal.remove();
});
|
|