繁体   English   中英

Angular-ui模态指令

[英]Angular-ui modal directive

接下来是Angular UI模态指令的文档末尾

In addition the scope associated with modal's content is augmented with 2 methods: * $close(result) * $dismiss(reason) Those methods make it easy to close a modal window without a need to create a dedicated controller

我看到这是在提交http://github.com/angular-ui/bootstrap/commit/8d153acb中实现的

有没有关于如何使用它的例子。 我也想避免为doc中给出的示例编写控制器。 plnkr 因此,我正在寻找一种方法来避免为简单的功能创建ModalInstanceCtrl (通过表单输入,显示一些数据)。

在你的模态形式中只需使用:

<button ng-click="$close(result)">OK</button>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM