首页 新闻 赞助 找找看

angularjs modal 多个弹窗如何销毁当前显示上一个弹窗。

0
悬赏园豆:10 [待解决问题]

类似tree 第一次展现顶级菜单。点击其中一项弹窗展示下面的子级,页面都是一样的。

使用的是$scope.detailsModal

例如:

list.html页面

1.abc 

2.dfg

点击 abc 弹窗 (页面模板还是list.html)

渲染数据

1.rhg

2.yuf

只要点击项下面还有子项,就这样无限级可以弹窗。

 

图挂了:地址github地址

如图所示:点击左上角返回上一弹窗,销毁当前弹窗 (代码如下)

<br/>

$scope.detailsModals = new Map(); 

$scope.openDetailsModal = function (customerId) {

var temp_data = lrmNrwrate.get(customerId);

if (temp_data.childCount <= 0) {

 return;

}

$scope.detailsData = temp_data;

var tempdetailsModal = $scope.detailsModals.get(customerId);

if (tempdetailsModal != null) {

$scope.detailsModals.delete(customerId);

tempdetailsModal.remove();

}

//if ($scope.detailsModal != null) {

// $scope.detailsModal.remove();

//}

$ionicModal.fromTemplateUrl('templates/homeApps/nrwrates/nrwRate.html', {

scope: $scope,

animation: 'lr-slide-in-right'

}).then(function (modal) {

$scope.detailsModals.set(customerId, modal);

$scope.detailsModals.get(customerId).show();

//$scope.detailsModal = modal;

//$scope.detailsModal.show();

lrmNrwrate.getSearchList();

$scope.DetailSerach($scope.detailsData.createMonth, $scope.detailsData.areaId);

});

};

$scope.closeDetailsModal = function () {

var id = $scope.detailsData.areaId;

if (id != null) {

var temp= $scope.detailsModals.get(id);

$scope.detailsModals.delete(id);

$scope.detailsModal = temp;

$scope.detailsModal.remove();

};

求解?????

apgk的主页 apgk | 初学一级 | 园豆:47
提问于:2018-04-17 09:07
< >
分享
所有回答(1)
0

参考:https://www.cnblogs.com/lmy2016/p/6118916.html

金琥 | 园豆:2605 (老鸟四级) | 2018-04-17 14:30
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册