我正在开发一个具有ui-router模块的角度应用程序.
当进入路由器的某个状态时,我会显示一个模态对话框,然后替换我的父视图.我想保留父视图并将模态显示为叠加.有没有办法用ui-router做到这一点?
@H_502_9@当进入路由器的某个状态时,我会显示一个模态对话框,然后替换我的父视图.我想保留父视图并将模态显示为叠加.有没有办法用ui-router做到这一点?
举个例子:
$stateProvider.state("clients.list",{ url: "/list",templateUrl: "app/client/templates/client-list.tpl.html",controller: moduleNamespace.clientListController,resolve: { clients: function (ClientService) { return ClientService.all(); } } }) // This will replace "clients.list",and show the modal // I want to just overlay the modal on top of "clients.list" .state("clients.add",{ url: "/add",onEnter: function ($stateParams,$rootScope,$state,ngDialog) { ngDialog.open({ controller: moduleNamespace.clientAddController,template: "app/client/templates/client-add.tpl.html" }); $rootScope.$on("ngDialog.closed",function (e,$dialog) if ($state.current.name !== "clients.list") $state.transitionTo("clients.list"); }); } })
谢谢