Angular UI Bootstrap modal - 使用自定义模态窗口 [英] Angular UI Bootstrap modal - use custom modal window
问题描述
如链接中所述 http://angular-ui.github.io/bootstrap(从顶部的 Directive 下拉菜单中选择 modal),有一个名为 windowTemplateUrl 的参数,用于覆盖模态内容.因此,如果我们使用它,在 templateUrl 或模板中给出什么,因为调用 modal 的 open 函数需要其中之一.例如代码如下.
As given in the link http://angular-ui.github.io/bootstrap ( select modal from Directive drop down on top), there is a parameter called windowTemplateUrl which is used to over ride the modal content. So, in case we are using this, what to give in templateUrl or template, as one of these is required for calling the open function of modal. For e.g. the code is given below.
$scope.open = function(){
var modalInstance = $modal.open({
windowTemplateUrl : '/client/content.html'
})
}
如果我运行上面的代码,它会给出需要 templateUrl 或模板的错误.那么,我如何使用 windowTemplateUrl.
If I run the code as above, it gives error that templateUrl or template is required. So, how do I use windowTemplateUrl.
推荐答案
windowTemplateUrl
是一个窗口装饰的模板:https://github.com/angular-ui/bootstrap/blob/master/template/modal/window.html
您仍然需要提供您希望看到装饰的模态的内容(使用template
或templateUrl
).
You still need to supply modal's content (using template
or templateUrl
) that you would like to see decorated.
这篇关于Angular UI Bootstrap modal - 使用自定义模态窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!