作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
现场示例:http://plnkr.co/edit/wWS3UFB3IZ0cAI4u2x04?p=preview
点击“Open Modal 1”时,抛出以下错误:
Error: Dialog.open expected template or templateUrl, neither found. Use options or open method to specify them.
ng-include
的 Modal 2 工作正常。
ui-bootstrap-tpls-0.1.0.js
而不是
ui-bootstrap-tpls-0.2.0.js
,则一切正常。
最佳答案
我相信这个问题是将 modal 指令更改为终端的结果。这意味着其他指令(例如 ng-include)不会与 modal 一起处理。这是进行此更改的提交:
https://github.com/angular-ui/bootstrap/commit/ec796ec2299d03ddfb821e97047c0329f11ab962#src/modal/modal.js
老实说,我对此并不了解,无法确切知道为什么该指令应该是终端,但一个简单的解决方案是将 ng-include 用作 modal 的子级,而不是作为作用于同一元素的第二个指令。这就是我的意思:
<div modal="opened1">
<ng-include src="'modal1.html'"></ng-include>
</div>
关于angularjs - Angular UI Bootstrap Modal 不适用于 ng-include,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15384037/
我是一名优秀的程序员,十分优秀!