在我的Onsenui应用程序中添加登录页面 [英] Add a login page in my Onsenui app
本文介绍了在我的Onsenui应用程序中添加登录页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在进入主页面之前设置登录页面。
如何在此指示之前完成此操作:
I'd like to set a login page before entering the main page. How can I do that just before this instruction :
<ons-screen page="sliding_menu.html"></ons-screen>
我使用Monaca IDE
I use The Monaca IDE
谢谢求助
Charles
推荐答案
您可以尝试这种方式:
You can try this way:
index.html
<ons-screen page="login.html"
login.js
function LoginController($scope){
$scope.login = function(id, password){
$scope.ons.screen.presentPage('sliding_menu.html');
}
}
login.html
<div class="page center" ng-controller="LoginController">
<div class="row">
<div class="col">
<ons-text-input placeholder="id" ng-model="id">
</ons-text-input>
</div>
</div>
<div class="row">
<div class="col">
<input type="password" placeholder="password" ng-model="password" class="topcoat-text-input">
</div>
</div>
<div class="row">
<div class="col">
<ons-button ng-click="login(id, password)">
Login
</ons-button>
</div>
</div>
</div>
演示:
http://onsenui.github.io/stackoverflow/sliding_menu_login/app/
下载src:
http://onsenui.github.io/stackoverflow/sliding_menu_login.zip
这篇关于在我的Onsenui应用程序中添加登录页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文