Angular bootstrap 模态
Angular bootstrap modal
我正在使用 ui-bootstrap-tpl 版本 2.4.0 和 Angular 对话服务,但模态有问题。
关闭模态时出现问题:
- 如果我单击“确定”,它会关闭并且没有错误。
- 如果我单击“取消”,它会关闭但在控制台中出现错误 window:
Possibly unhandled rejection: cancel
- 如果我点击外部模式,它会关闭但出现错误:
Possibly unhandled rejection: backdrop click
是否要修复它?非常感谢!
您忘记处理模态的 dismiss
情况。
这是一个更新的插件:https://plnkr.co/edit/M5OnOcJJG65pinWe2iKt
基本上,你需要做这样的事情:
dialog.result.then(
function () {
// success case
console.log('ok');
},
function () {
// dismiss case
console.log('cancel');
}
);
我正在使用 ui-bootstrap-tpl 版本 2.4.0 和 Angular 对话服务,但模态有问题。
关闭模态时出现问题:
- 如果我单击“确定”,它会关闭并且没有错误。
- 如果我单击“取消”,它会关闭但在控制台中出现错误 window:
Possibly unhandled rejection: cancel
- 如果我点击外部模式,它会关闭但出现错误:
Possibly unhandled rejection: backdrop click
是否要修复它?非常感谢!
您忘记处理模态的 dismiss
情况。
这是一个更新的插件:https://plnkr.co/edit/M5OnOcJJG65pinWe2iKt
基本上,你需要做这样的事情:
dialog.result.then(
function () {
// success case
console.log('ok');
},
function () {
// dismiss case
console.log('cancel');
}
);