Angular Bootstrap UI模态没有显示
Angular Bootstrap UI modal not showing
我试图从angular ui bootstrap中使用模态,但它没有显示,尽管窗口是模糊的,当代码显示模态执行,
模态的代码为:
<script type="text/ng-template" id="test.html">
<div class="modal-header">
<h3>XXXX</h3>
</div>
<div class="modal-body">
<p>XXXX</p>
</div>
<div class="modal-footer">
xxxxxx
</div>
</script>
按钮显示模式:
<div class="container-fluid" ng-controller="MainController">
<button ng-click="showModal()" ></button>
</div>
控制器:
var app = angular.module('angularjs-starter', ['ui.bootstrap']);
app.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/', {
templateUrl: '/home.html'
});
}]);
app.controller('MainController', function($scope, $rootScope, $modal) {
$scope.showModal = function() {
$modal.open({templateUrl:'test.html', backdrop: true,windowClass: 'modal'});
};
});
以上代码有问题吗?
我的问题是,我包括两个js文件(ui-bootstrap.min.js和ui-bootstrap-tpl .min.js)当我应该只加载'ui-bootstrap-tpl .min.js'。在那之后,它就像一个魅力。
我有同样的问题,使用:
windowClass : 'show'
中的$modal。
AngularUI modal的文档中说
windowClass -添加到模态窗口模板的额外CSS类
你正在使用的这个'modal'是哪个类?这个类是你自己定义的吗?这应该不是问题,但请尝试删除
相关文章:
- 有没有比在app.js上绑定模块名称更好的方法来动态加载视图模型和视图以显示模态
- 如何在单击/接受/确认按钮后不再显示模态
- 如何从url中显示模态内部的信息
- 在下拉列表选择中显示模态
- 在表单提交后显示模态,直到加载下一页为止..不适用于狩猎
- 仅使用JAVASCRIPT单击链接或文本时显示模态
- 如何在单击表行时显示模态
- 显示模态对话;在 IE 中打开一个新窗口
- 在顶部框架上显示模态弹出窗口
- 如何在用户离开网页时显示模态窗口
- 获取 AngularJS 应用程序以在单击时显示模态
- 显示模态时未触发 Twitter 引导模态事件
- Twitter Bootstrap v3.0.0 未显示模态组件
- React - 如何填充和显示模态,然后在提交时发送 AJAX 请求
- 跨浏览器显示模态对话框替换
- 铬CEF显示模态对话问题
- 显示模态并在循环时等待每个元素的操作
- PHP中用于显示模态的Echo Javascript函数显示不正确
- 当点击rails中的提交按钮时,如何在重定向到下一页之前显示模态
- Foundation 5显示模态未打开