Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <html ng-app="app">
<body ng-controller="AppController">
<ons-navigator title="Navigator" var="myNavigator">
 
    <ons-page>
      <ons-toolbar>
      <div class="center">Onsen UI App</div>
      <div class="right">

        <ons-icon icon="ion-plus-circled" size="40px" onclick="myNavigator.pushPage('register.html', { animation : 'slide' } )"></ons-icon>

      </div>
      
    </ons-toolbar>

      <ons-list>
        <ons-list-item>
          <input ng-model="data.username" type="text" placeholder="Username" class="text-input text-input--transparent" style="margin-top:8px; width: 100%;">
        </ons-list-item>

        
        <ons-list-item>
          <input ng-model="data.password" type="password" placeholder="Password" class="text-input text-input--transparent" style="margin-top:8px; width: 100%;">        </ons-list-item>

        


        
      </ons-list>
      

      <div class="content-padded">
        <ons-button id="btnSignIn" modifier="large"
                 ng-click="SignIn()"   >
          SignIn
        </ons-button>
      </div>

    <ons-modal ng-click="modal.hide()" var="modal">
  
  <br><br>
  Invalid Username or Password.<br>
</ons-modal>
    </ons-page>
   
  </ons-navigator>  

<ons-template id="register.html">
    <ons-page>
        <ons-toolbar>
            <div class="left">
                <ons-back-button>Back</ons-back-button>
            </div>
            <div class="center">Register</div>
        </ons-toolbar>

        <div style="text-align: center">
            <br />
            <ons-page>


                <ons-list>
                    <ons-list-item>
                        <input type="text" placeholder="Username" class="text-input text-input--transparent" style="margin-top:8px; width: 100%;">
                    </ons-list-item>

                    <ons-list-item>
                        <input type="text" placeholder="Email Address" class="text-input text-input--transparent" style="margin-top:8px; width: 100%;">
                    </ons-list-item>
                    <ons-list-item>
                        <input type="text" placeholder="Password" class="text-input text-input--transparent" style="margin-top:8px; width: 100%;">
                    </ons-list-item>

                    <ons-list-item>
                        <ons-row>
                            <ons-col width="90px">
                                <span style="color: #666">Gender</span>
                            </ons-col>
                            <ons-col>

                                <div style="float: right; padding-right: 16px;">
                                    <label class="radio-button">
                                        <input type="radio" name="level">
                                        <div class="radio-button__checkmark"></div>
                                        Male
                                    </label>

                                    <label class="radio-button">
                                        <input type="radio" name="level">
                                        <div class="radio-button__checkmark"></div>
                                        Female
                                    </label>
                                </div>

                            </ons-col>
                        </ons-row>
                    </ons-list-item>



                </ons-list>


                <div class="content-padded">
                    <ons-button modifier="large" onclick="">
                        Sign Up
                    </ons-button>
                </div>


            </ons-page>
        </div>
    </ons-page>
</ons-template>
  
<ons-template id="home.html">
    <ons-page> 
        <ons-toolbar>
           
            <div class="center">Welcome</div>
          <div class="right">

        <ons-icon icon="ion-log-out" size="40px" title="Logout" style="cursor:pointer;" ng-click="logout()"
        ></ons-icon>

      </div>
        </ons-toolbar>

        <div style="text-align: center">
            <br />
            <ons-page>

<p style="padding-top: 100px; color: #999; text-align: center">Welcome Home {{username}}!!</p>

              <div> </div>


            </ons-page>
        </div>
    </ons-page>
</ons-template>


</body>
</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                ons.bootstrap();
(function(){
  'use strict';
  var module = angular.module('app', ['onsen']);

  module.controller('AppController', function($scope) {
    var firebaseRef = new Firebase('https://burning-fire-1723.firebaseio.com');

    var auth = new FirebaseSimpleLogin(firebaseRef, function (error, user) {
    if (!error) {
        if (user) {
            console.log(user);
        }
    }
    });
    
    $scope.data = [];
    $scope.SignIn = function(){
      var user = $scope.data.username;
      var pass = $scope.data.password;
      if(user && pass){
        // success logic
         auth.login('password', {
                email: user,
                password: pass
            });
      }
      else{
        // failure logic
        modal.show();
      }
    }
    
    $scope.logout = function(){
      auth.logout();
      $scope.data = [];
      myNavigator.popPage();
    }
  });
  
  
})();

              
            
!
999px

Console