【发布时间】:2016-08-05 10:28:51
【问题描述】:
基本上我正在将旧样式 window.confirm 对话框转换为 bootsrap 对话框。我在 Angular 代码中调用 Javascript 函数,即
function showConfirmation(msg)
{
jQuery('#confirmationModal .modal-body h2').html(msg);
jQuery('#confirmationModal').modal();
}
角度代码:
{
Converting from old style confirmation box
//if(!window.confirm('Are you sure ')
var msg= 'Are you sure';
if(ShowConfirmation(msg))
{
}
}
现在在 Angular 代码中,我需要从确认对话框中获取 True /false 值,还需要根据用户输入恢复执行。
【问题讨论】:
-
我倾向于创建一个模式服务,其中一个范围可以从控制器传递到另一个,然后再返回。上面的代码对我来说似乎不是“角度方式”。
-
@DanielShillcock 您在 Angular 代码中创建模态 html 吗?你有示例代码吗?
-
见angular-ui.github.io/bootstrap/#/modal - 一个非常好的指令资源
-
我确实看起来有棱角的 ui 或 bootbox。但我想创建自己的
标签: javascript jquery angularjs twitter-bootstrap