cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <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="Email Address" ng-model="reg.email" class="text-input text-input--transparent" style="margin-top:58px; width: 100%;">
                    </ons-list-item>
                    <ons-list-item>
                        <input type="text" ng-model="reg.pass" 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" ng-click="SignUp()">
                        Sign Up
                    </ons-button>
                </div>


            </ons-page>
        </div>
      <ons-modal ng-click="modal.hide()" var="modal">
  
  <br><br>
  Enter Email Address and Password.<br>
</ons-modal>
    </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>
            
          
!
            
              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.username = user.email;
            myNavigator.pushPage('home.html', { animation : 'slide' } );
        }
    }
     else{
       console.log(error);
     }
    });
    
    $scope.data = [];
    $scope.reg = [];
    $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();
    }
    
    $scope.SignUp = function(){
    var email = $scope.reg.email;
    var password = $scope.reg.pass;
    if(email && password){
    auth.createUser(email, password, function (error, user) {
                if (!error) {
                    myNavigator.popPage();
                }
                else{
                  alert('error');
                }
     });
    }
      else{
        modal.show();
      }
    }
  });
  
  
  
  
})();

            
          
!
999px
Loading ..................

Console