“关闭”模态和“关闭”模态之间的区别是什么?
close(result) - a method that can be used to close a modal,passing a result dismiss(reason) - a method that can be used to dismiss a modal,passing a reason
答案在文档中,紧接着你引用的两行:
原文链接:https://www.f2er.com/angularjs/146608.htmlThe open method returns a modal instance,an object with the following properties:
- close(result) – a method that can be used to close a modal,passing a result
- dismiss(reason) – a method that can be used to dismiss a modal,passing a reason
- result – a promise that is resolved when a modal is closed and rejected when a modal is dismissed
这里的重要位置是承诺发生了什么。关闭,承诺被解决 – 本质上,“成功”回调触发。在关闭时,promise被拒绝,因此运行“failure”回调。