meteor-useraccounts / ionic

Accounts Templates styled for Ionic.
http://useraccounts.meteor.com/
MIT License
27 stars 17 forks source link

How to close ionModal? #15

Open MichaelJCole opened 9 years ago

MichaelJCole commented 9 years ago
<template name="signIn">
  {{#ionModal title="Welcome :-)"}}

    {{> atForm}}

  {{/ionModal}}
</template>

On success, the user is logged in, but the modal does not close.

How do I close the modal? I don't see a way to send a callback to the atForm.

ionModal is from the Meteoric project.

The example uses IonModal.close() to close the modal.

  'click .loginForm-signin': function(e, template) {
    template.error.set(false);
    Meteor.loginWithPassword(
      $('#formEmail').val(),
      $('#formPassword').val(),
      function(err) {
        if (err) return template.error.set(Helpers.decodeLoginError(err));
        // Login was a success.  Record in profile.
        Meteor.users.update(Meteor.userId(), {
          $set: { 'profile.lastPhoneAppLogin': new Date() }
        });
        IonModal.close();
      }
    );
  },

Thanks!

Mike