使用angularjs打开和关闭Bootstrap模式弹出窗口不起作用 [英] Bootstrap modal popup open and close using angularjs not working

查看:30
本文介绍了使用angularjs打开和关闭Bootstrap模式弹出窗口不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 angularjs controller.js 代码打开和关闭引导模型弹出窗口.

Hi i want to open and close the bootstrap model popup by using angularjs controller.js code.

我的控制器代码

app.controller('RoleViewCtrlq', ['$scope', '$modalInstance', '$modal',
function ($scope, $modalInstance, $modal) {


    $scope.open = function () {
        debugger;
        var modalInstance = $modal.open({
            templateUrl: 'myModalContent.html',
        });


        $scope.ok = function () {
            $modalInstance.close();
        };

        $scope.cancel = function () {
            $modalInstance.dismiss('cancel');
        };


    }
}
]);

我在这里创建了示例https://plnkr.co/edit/xRhCR7qidlr24M8nAOA6?p=preview

无法在 controller.js 代码中打开和关闭我的弹出窗口.任何人都可以检查这个问题.??

it is not working to open and close my pop up in controller.js code. can any one check the issue.??

推荐答案

 <script type="text/ng-template" id="myModalContent.html">

从 HTML 中删除此脚本标记,然后重试.它正在工作

Remove this script tag from HTML and try again. It is working

这篇关于使用angularjs打开和关闭Bootstrap模式弹出窗口不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆