棘轮拼焊板 - 如何关闭模式maually? [英] TWBS Ratchet - How to close modal maually?

查看:336
本文介绍了棘轮拼焊板 - 如何关闭模式maually?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在建设有一个棘轮移动Web应用程序。结果
我要做的是打开一个模态,填表格,preSS一个按钮,然后保存并关闭模式。结果
现在,我可以关闭一个模式与它的documentated按钮,我也能够保存表单字段...但如何做这些东西放在一起?结果
在棘轮的文档它没有解释如何手动关闭模式通过JS。结果
我使用的棘轮与angularjs,使按键调用一个函数agular,其中我应该关闭模式。结果
谢谢

I'm building a mobile web app with Ratchet.
What I have to do is opening a modal, fill a form, press a button then save and close the modal.
Now, I'm able to close a modal with it's documentated button, and I'm also able to save the form field...but how to do those things together?
In Rachet's documentation it's not explained how to close a modal manually via js.
I'm using ratchet with angularjs, so the button calls an agular function, in which I should close the modal.
Thanks

推荐答案

好吧,我终于解决了这个方式。结果
在我的模式我已经添加了这个按钮

Ok, finally I solved this way.
In my modal I've added this button

<button class="btn" ng-click="add();" href="#myModal">Save</button>

通过pressing此按钮,我想一些逻辑后关闭模式。
所以,这是我的逻辑:

By pressing this button I wanted to close the modal after some logic. So, this is my logic:

$scope.add = function() {
  // My logic here
  jQuery('#myModal').removeClass('active');
};

我希望这可以帮助别人...

I hope this can help someone else...

这篇关于棘轮拼焊板 - 如何关闭模式maually?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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