【发布时间】:2017-02-13 18:11:40
【问题描述】:
我正在关注 angular recipes page 向我的用户界面添加模式对话框。它建议了以下标记,我已将其添加到我的一个观点中。
... html for my view is here ...
<button class="btn" ng-click="open()">Open Modal</button>
<div modal="showModal" close="cancel()">
<div class="modal-header">
<h4>Modal Dialog</h4>
... etc, from the recipe doc
</div>
我想看到的是我的视图,加上底部的“打开模态”按钮,没有别的。相反,我看到的是页面上已经可见的按钮和模式的内容。
食谱文档中的下一句话是:
请注意,即使我们没有明确指定模式对话框 最初通过 modal 属性隐藏。仅控制器 处理按钮单击和模式使用的 showModal 值 属性。
为什么我的模态标记最初在页面上可见?我想我已经在我的 index.html 中正确安装了 angular-ui:
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
在我的应用 JS 中:
angular.module('MonteAdmin', [
...
'ui.bootstrap',
...
])
【问题讨论】:
标签: html angularjs angular-ui angular-ui-modal