Mobile Angular UI越来越受欢迎了,只有bootstrap 3和angularjs组合
我想在按钮上单击创建一个模态对话框并关闭关闭图标上的对话框,怎么做?
基于它所说的docs
<div ui-content-for="modals">
<div class="modal" ui-if="modal1" ui-state='modal1'>
.....
</div>
</div>
但如何调用此对话框,我尝试了这个
<button ui-turn-on="modal1" class="btn btn-primary">Show Model</button>
但它没有按预期工作,我收到Warning: Attempt to set uninitialized shared state: modal1
错误
答案 0 :(得分:2)
我认为您已将ui-content-for
放入ui-yield-to
将其置于div
标记之外,如下所示
<div ui-yield-to="modals"></div>
<div ui-content-for="modals">
<div class="modal" ui-if="modal1" ui-state="modal1">
....your model html code
</div>
</div>
这样modals
将继续作为占位符