angularjs twitter bootstrap模态没有显示

gui*_*mie 2 javascript twitter-bootstrap angularjs

当我点击下面定义的按钮时,模态框不会显示.如果我使用chrome开发工具,我会看到我的div"modalDisplay"填充了我的modalDisplay.html内容,但是当我点击按钮时,没有任何反应,没有错误,什么都没有.我正在使用angularjs与angularjs bootstrap插件

在我的部分视图中,我有以下内容:

<div id="modalDisplay" class="modal hide fade" ng-include="'./app/templates/modalDisplay.html'"></div>

<button class="btn btn-primary" href="#modalDisplay" data-toggle="modal" ng-show="displayType=='Customer'">
Show Modal
</button>
Run Code Online (Sandbox Code Playgroud)

在我的modalDisplay.html中

<div ng-controller="mODALCtrl" class="ng-scope">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h3>My modal</h3>
    </div>
    <div class="modal-body">
        <p>One fine body…</p>
        <div></div>
    </div>
    <div class="modal-footer">
        <a href="#" class="btn" data-dismiss="modal">Cancel</a>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

小智 6

这是正常的,你应该使用这个组件的指令.

您可以使用angular-strap指令http://mgcrea.github.io/angular-strap/#/modal或angular-ui http://angular-ui.github.io/bootstrap/#/modal