Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
21
rated 0 times [  24] [ 3]  / answers: 1 / hits: 7889  / 10 Years ago, mon, march 3, 2014, 12:00:00

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>


I use The Monaca IDE



Thanks for the help



Charles


More From » mobile

 Answers
23

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>


Demo:
http://onsenui.github.io/stackoverflow/sliding_menu_login/app/



Download src:
http://onsenui.github.io/stackoverflow/sliding_menu_login.zip


[#47219] Sunday, March 2, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
masonm

Total Points: 167
Total Questions: 87
Total Answers: 103

Location: Rwanda
Member since Wed, Jun 8, 2022
2 Years ago
masonm questions
;