javascript - Angular UI Bootstrap 模态 - 使用自定义模态窗口

标签 javascript angularjs angular-ui-bootstrap bootstrap-modal

如链接http://angular-ui.github.io/bootstrap中所示(从顶部的“指令”下拉列表中选择模态),有一个名为 windowTemplateUrl 的参数,用于覆盖模态内容。因此,如果我们使用这个,在 templateUrl 或 template 中给出什么,因为调用模态的 open 函数需要其中之一。例如代码如下。

$scope.open = function(){
  var modalInstance = $modal.open({
      windowTemplateUrl : '/client/content.html'
  })
}

如果我运行上面的代码,它会给出需要 templateUrl 或 template 的错误。那么,我该如何使用windowTemplateUrl。

最佳答案

windowTemplateUrl 是窗口装饰的模板: https://github.com/angular-ui/bootstrap/blob/master/template/modal/window.html

您仍然需要提供您希望看到的装饰模式的内容(使用templatetemplateUrl)。

关于javascript - Angular UI Bootstrap 模态 - 使用自定义模态窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24696224/

相关文章:

javascript - Node.js - 在继续之前从 MySQL 获取返回值

angularjs - 将复杂的 javascript 对象转换为查询字符串时遇到问题

javascript - 带有图像的水平下拉选择

angularjs - Angular Typeahead 指令 - 访问匹配元素

twitter-bootstrap - 我如何使用 bootstrap 类在一行内进行 10 个类似的划分。 (例如 "col-lg-2")

javascript - 将 .each() 绑定(bind)到动态添加的元素

javascript - d3 根据窗口大小缩放矩形宽度

angularjs - 如何查看ng-repeat中包含的ng-model?

javascript - 嵌套在指令元素中的 uibCollapse 将不起作用,

javascript - 使用 Javascript 事件 onbeforeunload,是否可以执行除警报对话框之外的其他操作?