在使用了 ui-router 的应用中可以使用哪个弹窗模态

Which pop up modal can be used in the app in which ui-router has been used

我创建了一个网页,其中通过使用 UI-router 打开每个页面的不同状态,每个页面都有可能通过 ng-include 集成的模块,现在我有弹出模式需要集成到我的网页中的要求,但弹出模式没有按预期工作是他们的任何弹出模式,我可以在我的网页中使用

您可以使用 Angular 模态服务来创建模态。 请参考以下link。 https://angular-ui.github.io/bootstrap/

我正在使用 ngDialog 和 ui 路由器。您可以在这里阅读:

Modals and popups provider for Angular.js applications. No dependencies. Highly customizable.

很有魅力。

documentation page you can see how to pass the scope or any other information you will need into the scope of the dialog to create the logic you need in your modal dialog. Taken from the documentation 上:

$scope.value = true;

ngDialog.open({
    template: 'externalTemplate.html',
    className: 'ngdialog-theme-plain',
    scope: $scope
});

带控制器:

ngDialog.open({
    template: 'externalTemplate.html',
    scope: $scope
    controller: ['$scope', 'otherService', function($scope, otherService) {
        // controller logic
    }]
});

在您的场景中,也许可以在 link 上使用 ng-click。在 ng-click 函数中执行一些逻辑,然后使用适当的数据在此函数中打开 ngDialog。那有意义吗?或者首先打开对话框并使用传递的数据在对话框本身中加载所需的数据可能更好。也许是更好的用户体验! ;)