1

Ratchet を使用してモバイル Web アプリを作成しています。私がしなければならないことは、モーダルを開いてフォームに入力し、ボタンを押してモーダルを保存して閉じることです。

文書化されたボタンでモーダルを閉じることができ、フォームフィールドを保存することもできます...しかし、それらを一緒に行うにはどうすればよいですか? Ratchet のドキュメントでは、JavaScript を使用して手動でモーダルを閉じる方法については説明されていません。

私は AngularJS で Ratchet を使用しているので、ボタンはモーダルを閉じる必要がある Angular 関数を呼び出します。

4

1 に答える 1

8

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

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

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...

于 2014-03-25T11:13:20.803 に答える