css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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 Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <html ng-app="ionicApp">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

    <title>Ionic Template</title>

    <link href="https://code.ionicframework.com/1.0.0-beta.1/css/ionic.css" rel="stylesheet">
    <script src="https://code.ionicframework.com/1.0.0-beta.1/js/ionic.bundle.js"></script>
  </head>

  <body ng-app="starter" animation="slide-left-right-ios7">

    <ion-nav-view id="main"></ion-nav-view>


    <script id="menu.html" type="text/ng-template">

      <ion-side-menus>

        <ion-pane ion-side-menu-content>
          <ion-nav-bar class="bar-positive">
            <ion-nav-back-button class="button-clear"><i class="icon ion-ios7-arrow-left"></i></ion-nav-back-button>
          </ion-nav-bar>
          <ion-nav-view name="menuContent" animation="slide-left-right"></ion-nav-view>
        </ion-pane>

        <ion-side-menu side="left">
          <header class="bar bar-header bar-dark">
            <h1 class="title">Menu</h1>
          </header>
          <ion-content class="has-header">
            <ion-list>
              <ion-item item-type="item-icon-left" nav-clear menu-close href="#/app/main">
                <i class="icon ion-home"></i>
                Home
              </ion-item>
              <ion-item item-type="item-icon-left" nav-clear menu-close href="#/app/kredit">
                <i class="icon ion-grid"></i>
                Kredit
              </ion-item>
              <ion-item item-type="item-icon-left" nav-clear menu-close href="#/app/profile">
                <i class="icon ion-document-text"></i>
                Report
              </ion-item>
              <ion-item item-type="item-icon-left" nav-clear menu-close href="#/app/setting">
                <i class="icon ion-settings"></i>
                Setting
              </ion-item>
              <ion-item item-type="item-icon-left" nav-clear menu-close ng-click="logout()">
                <i class="icon ion-log-out"></i>
                Logout
              </ion-item>
            </ion-list>
          </ion-content>
        </ion-side-menu>

      </ion-side-menus>

    </script>


    <script id="kredit-cek-baki.html" type="text/ng-template">
      <ion-view title="Cek Baki">

        <ion-nav-buttons side="right">
          <button class="button button-icon ion-search" ng-click="showModal()"></button>
        </ion-nav-buttons>

        <ion-content has-header="true" padding="true">

          <div ng-switch on="result">
            <div ng-switch-when="true">
              <div class="list">
                <div class="item">
                  <h2>No Rekening</h2>
                  <p>{{ data.rekening }}</p>
                </div>
                <div class="item">
                  <h2>Nama Debitur</h2>
                  <p>{{ data.namaDebitur }}</p>
                </div>
                <div class="item">
                  <h2>Baki Debet</h2>
                  <p>Rp{{ data.bakiDebet }},00</p>
                </div>
              </div>
            </div>
            <div ng-switch-default>
              <p>Tap ikon search di pojok kanan atas untuk mencari rekening</p>
            </div>
          </div>

        </ion-content>

      </ion-view>

    </script>

    <script id="new-task.html" type="text/ng-template">

      <div class="modal">

        <!-- Modal header bar -->
        <ion-header-bar class="bar-positive">
          <h1 class="title"></h1>
          <button class="button button-clear" ng-click="closeModal()">Cancel</button>
        </ion-header-bar>

        <!-- Modal content area -->
        <ion-content>

          <div class="list">
            <label class="item item-input">
              <span class="input-label">No Rekening</span>
              <input type="number" ng-model="data.rekening">
            </label>
            <label class="item item-input">
              <span class="input-label">Password/PIN</span>
              <input type="password" ng-model="data.password">
            </label>
          </div>
          <div class="padding">
            <button class="button button-block button-positive" ng-click="submitModal(data)">
              Submit
            </button>
          </div>

        </ion-content>

      </div>

    </script>    
  </body>
</html>

            
          
!
            
              body {
  cursor: url('https://ionicframework.com/img/finger.png'), auto;
}
            
          
!
            
              angular.module('ionicApp', ['ionic'])

.run(function($ionicPlatform) {
    $ionicPlatform.ready(function() {
        if(window.StatusBar) {
            // org.apache.cordova.statusbar required
            StatusBar.styleDefault();
        }
    });
})

.config(function($stateProvider, $urlRouterProvider) {

    // Ionic uses AngularUI Router which uses the concept of states
    // Learn more here: https://github.com/angular-ui/ui-router
    // Set up the various states which the app can be in.
    // Each state's controller can be found in controllers.js
    $stateProvider

        // default page when first loaded
        .state('signin', {
            url: "/sign-in",
            templateUrl: "templates/sign-in.html",
            controller: 'SignInCtrl'
        })

        // abstract/default layout after sign-in
        .state('app', {
            url: '/app',
            abstract: true,
            templateUrl: "templates/menu.html",
            controller: "AppCtrl"
        })

        // default page after sign-in
        .state('app.main', {
            url: "/main",
            views: {
                'menuContent': {
                    templateUrl: "templates/main.html",
                    controller: "MainCtrl"
                }
            }
        })

        // page for "kredit" main
        .state('app.kredit', {
            url: "/kredit",
            views: {
                'menuContent': {
                    templateUrl: "templates/kredit.html",
                    controller: "KreditCtrl"
                }
            }
        })

        // page for "kredit/cek-baki" main
        .state('app.cek-baki', {
            url: "/cek-baki",
            views: {
                'menuContent': {
                    templateUrl: "templates/kredit-cek-baki.html",
                    controller: "CekBakiCtrl"
                }
            }
        })

        // page for "kredit/cek-baki" main
        .state('app.setting', {
            url: "/setting",
            views: {
                'menuContent': {
                    templateUrl: "templates/setting.html",
                    controller: "SettingCtrl"
                }
            }
        })

    // if none of the above states are matched, use this as the fallback
    $urlRouterProvider.otherwise("/main");

})

.controller('CekBakiCtrl', function ($scope, $state, $ionicPopup, $ionicModal) {
        $scope.data     = {};
        $scope.result   = false;

        // Create and load the Modal
          $ionicModal.fromTemplateUrl('new-task.html', function(modal) {
            $scope.modal = modal;
          }, {
            scope: $scope,
            animation: 'slide-in-up',
            focusFirstInput: true
          });

          // Called when the form is submitted
        $scope.submitModal = function(data) {
            if ( ! $scope.data.rekening) {
                $ionicPopup.alert({
                    title: 'Rekening harus di isi'
                });
                return;
            }

            if ( ! $scope.data.password) {
                $ionicPopup.alert({
                    title: 'Password harus di isi'
                });
                return;
            }

            console.log(data);
            data.rekening = data.password = "";
            $scope.modal.hide();
            $scope.data.rekening    = '101-12345';
            $scope.data.namaDebitur = 'John Doe';
            $scope.data.bakiDebet   = '100.000';
            $scope.result   = true;
        };

        // Open our new task modal
        $scope.showModal = function() {
            $scope.modal.show();
            $scope.result   = false;
        };

        // Close the new task modal
        $scope.closeModal = function() {
            $scope.modal.hide();
        };
    })
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console