我正在尝试在我的 Android 手机中安装一个用流星制作的应用程序。该应用程序是通过
meteor build /home/sampad/meteor_apk --server 192.168.1.27:3000
这个应用程序包含 2 个模板。当我单击提交时,它会将我带到下一个模板,在桌面运行时通过meteor
. 但是在移动设备中运行它时,单击提交按钮不会带我到任何地方,我也看不到任何错误。
附上代码:
<!-- main.html -->
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Accounts Page</a>
</div>
</div>
</nav>
<div class="container">
{{#if currentUser}}
{{>dashboard}}
{{else}}
{{> register}}
{{> login}}
{{/if}}
<hr>
</div>
<template name="register">
<form>
<h3>Registration Page</h3>
E-mail : <input type ="text" id="email"><br>
Password : <input type="password" id="password"><br>
<input type="submit" value="Save details"> <input type="reset" value="Reset">
</form>
</template>
<template name="login">
<form>
<h3>Log In Page</h3>
E-mail : <input type ="text" id="login-email"><br>
Password : <input type="password" id="login-password"><br>
<input type="submit" value="Log In"> <input type="reset" value="Reset">
</form>
</template>
<template name="dashboard">
<p> You 're logged in </p>
<p><a href ="#" class="logout" >Log Out</a></p>
</template>
<!-- main.js -->
if(Meteor.isClient)
{
Template.register.events({
'submit form':function(event,template){
event.preventDefault();
var emailVar = template.find('#email').value;
var passwordVar = template.find('#password').value;
//template.find('#message').append("Clicked submit");
console.log('Form submitted');
Accounts.createUser({
email:emailVar,
password:passwordVar
});
}
});
Template.login.events({
'submit form':function(event,template){
event.preventDefault();
var emailVar = template.find('#login-email').value;
var passwordVar = template.find('#login-password').value;
Meteor.loginWithPassword(emailVar,passwordVar);
}
});
Template.dashboard.events({
'click.logout':function(event){
event.preventDefault();
Meteor.logout();
}
});
}