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

查看:126
本文介绍了使用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

Here i have create the sample 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天全站免登陆