有什么区别&QUOT的差异;驳回"一个模式和"关闭"在角UI自举一个模式? [英] What is the difference between "dismiss" a modal and "close" a modal in Angular UI-Bootstrap?

查看:135
本文介绍了有什么区别&QUOT的差异;驳回"一个模式和"关闭"在角UI自举一个模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

之间有什么解雇一个模式,差异关闭一个模式?

 关闭(结果) - 可以用来关闭模式的方法,传递一个结果
解雇(原因) - 可用于关闭模态的方法,传递一个理由


解决方案

答案是在文档中,你引用了两行之后:


  

open方法返回一个模式的实例,具有以下属性的对象:


  
  

      
  • 关闭(结果) - 可以用来关闭模式的方法,通过结果

  •   
  • 关闭(原因) - 可用于关闭模态的方法,传递一个原因

  •   
  • 的结果 - 当一个模式被驳回时,一个模式是封闭的得到解决,拒绝承诺

  •   

  
  

最重要的一点是在这里发生了什么承诺。在接近,
  承诺解决 - 本质上,成功回调火灾。
  在辞退,许被拒绝,因此在运行失败
  回调来代替。


What is the difference between "dismiss" a modal and "close" a modal?

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

解决方案

The answer is in the documentation, right after the two lines you quoted:

The 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

The important bit here being what happens to the promise. On close, the promise is resolved - essentially, the "success" callback fires. On dismiss, the promise is rejected, therefore running the "failure" callback instead.

这篇关于有什么区别&QUOT的差异;驳回"一个模式和"关闭"在角UI自举一个模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆