模式加载后调用函数angularjs UI引导 [英] Call function after modal loads angularjs ui bootstrap
问题描述
我使用 Angularjs UI引导
渲染模式窗口在我的项目。但在某些情况下,我想模态加载后调用的函数。我曾尝试与 $超时
和 $ viewContentLoaded
,但没有用。任何一个可以帮助我解决这个问题。
I am using Angularjs UI bootstrap
to render Modal windows in my project. But In some situation I want to call a function after the modal loads. I have tried with $timeout
and $viewContentLoaded
but no use. can any one help me to resolve this issue.
感谢大家。
推荐答案
我通过角UI引导的文件,最后我找到了解决办法。
I go through the documentation of angular ui bootstrap and finally I found the solution.
的打开
方法返回一个模式实例
,与对象的打开
propertie:
The open
method returns a modal instance
, an object with the opened
propertie:
打开
- 一个诺
,当一个模式被下载内容的模板,并解决所有变量后,打开解决
opened
- a promise
that is resolved when a modal gets opened after downloading content's template and resolving all variables
到模型打开后调用函数。
to call function after model opens.
$modalInstance.opened.then(function(){
alert('hi');
});
这篇关于模式加载后调用函数angularjs UI引导的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!