类似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();
};
求解?????
参考:https://www.cnblogs.com/lmy2016/p/6118916.html