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>Side Menus</title>

    <link href="https://code.ionicframework.com/1.0.0-beta.1/css/ionic.min.css" rel="stylesheet">
    <link href="https://code.ionicframework.com/contrib/ionic-contrib-frosted-glass/ionic.contrib.frostedGlass.css" rel="stylesheet">
    
    <script src="https://code.ionicframework.com/1.0.0-beta.1/js/ionic.bundle.js"></script>
    <script src="https://code.ionicframework.com/contrib/ionic-contrib-frosted-glass/ionic.contrib.frostedGlass.js"></script>
  </head>
 
  <body>
    
    <div ng-controller="MainCtrl">       
      <ion-nav-view></ion-nav-view>
    </div>
    
    <script id="event-menu.html" type="text/ng-template">
      <ion-side-menus>
        
        <ion-side-menu-content>
          <ion-nav-bar class="bar-positive">
            <ion-nav-back-button class="button-icon ion-arrow-left-c">
            </ion-nav-back-button>
          </ion-nav-bar>
          <ion-nav-buttons side="left">
            <button class="button button-icon button-clear ion-navicon" menu-toggle="left">
            </button>
          </ion-nav-buttons>
          <ion-nav-view name="menuContent"></ion-nav-view>
        </ion-side-menu-content> 
        
        <ion-side-menu side="left">
          <ion-header-bar class="bar-frosted">
            <h1 class="title">Left Menu</h1>
          </ion-header-bar>
          <ion-content>
            <ul class="list">
              <a href="#/event/list" class="item">List 1</a>
              <a href="#/event/note" class="item">Teacher 2</a>
              <a href="#/event/note" class="item">Old UI 3</a>
              <a href="#/event/new" class="item">New UI 4</a>
            </ul>
          </ion-content>
        </ion-side-menu>
        
      </ion-side-menus>
    </script>
    
    <script id="home.html" type="text/ng-template">
      <ion-view title="Welcome">
        <ion-content padding="true">
          <p>Swipe to the right to reveal the left menu.</p>
          <p>(On desktop click and drag from left to right)</p>
        </ion-content>
      </ion-view>
    </script>
    
    <script id="new.html" type="text/ng-template">
      <ion-pane ng-controller="PageCtrl">
      <header frosted-bar class="bar bar-header bar-frosted">
        <h1 class="title">AAAAAAAa</h1>
      </header>
      <ion-content padding="true" class="has-header" start-y="120">
        <ol class="messages">
          <li ng-repeat="message in messages" ng-class="{'pull-right': message.user != currentUser}">
            <p ng-class="{'messages-blue': message.user != currentUser}"> 
              <span class="royal bold" ng-show="message.user == currentUser">Parent: </span>
              <span class="stable bold" ng-show="message.user != currentUser">Teacher: </span>
              {{message.content}}
            </p>
            <span class="positive" style="font-size: 10px">{{myDate | date}}</span>
          </li>
			  </ol>
      </ion-content>
      <ion-footer-bar align-title="left" class="bar-positive">
          <label class="item item-input" style="width:80%">
	          <input type="text" ng-model="message.content" placeholder="Type your message!">
          </label>
          
            <button id="sendMessage" class="button button-small" style="margin-left:5px;width:18%" ng-click="add(message)">
              <i class="ion-android-send"></i> 
            </button>
            <button id="attachment" class="button button-small" style="width:2%">
              <i class="ion-android-add"></i> 
            </button>
        </ion-footer-bar>
    </ion-pane>
    </script>
    
    
    <script id="list.html" type="text/ng-template">
      <ion-view title="Notes" left-buttons="leftButtons">
      <ion-content>
        <div class="list">
          <a href="#/event/new" class="item item-avatar">
            <img src="http://www.fillmurray.com/100/100">
              <h2> 
                 <span style="float: left">  Teacher 1 </span>
                 <span class="positive badge badge-royal" style="float: right"> English </span>
              </h2>
            <p> Some chat text... </p>
          </a>
          <a href="#/event/new" class="item item-avatar">
            <img src="http://nicenicejpg.com/100/100">
            <h2> 
                 <span style="float: left">  Teacher 2 </span>
                 <span class="positive badge badge-royal" style="float: right"> Maths </span>
              </h2>
            <p> Some chat text... </p>
          </a>
          <a href="#/event/new" class="item item-avatar">
            <img src="http://www.PLACECAGE.com/100/100">
              <h2> 
                 <span style="float: left">  Teacher 3 </span>
                 <span class="positive badge badge-royal" style="float: right"> Hindi </span>
              </h2>
            <p> Some chat text... </p>
          </a>
          <a href="#/event/new" class="item item-avatar">
            <img src="http://placehold.it/100x100">
              <h2> 
                 <span style="float: left"> 
                   Teacher 4
                   <i class="icon ion-person"></i>
                   <span style="text-align: left" class="badge badge-balanced"> Class Teacher </span>
                 </span>
                 <span class="positive badge badge-royal" style="float: right"> Science </span>
              </h2>
            <p> Some chat text... </p>
          </a>
          <a href="#/event/new" class="item item-avatar">
            <img src="http://www.fillmurray.com/100/100">
              <h2> 
                 <span style="float: left">  Teacher 5 </span>
                 <span class="positive badge badge-royal" style="float: right"> Computer </span>
              </h2>
            <p> Some chat text... </p>
          </a>
        </div>
      </ion-content>
    </script>
    
    <script id="note.html" type="text/ng-template">
      <ion-view title="Teacher 1" left-buttons="leftButtons">
        
        <ion-content padding="true">
          <div class="list">
            <div class="card">
              <div ng-repeat-start="attendee in attendees" class="item item-divider">
                <span ng-show="$odd" style="display:block;text-align:right"> Teacher 1 </span>
                <span ng-show="$even" style="display:block;text-align:left"> Parent </span>
              </div>
              <div class="item item-text-wrap" style="margin-bottom: 0px;">
                 Message {{attendee.firstname}} {{$index + $even + $odd}}
              </div>
              <div class="item item-divider bar-frosted" style="font-size: 10px; text-align: center" ng-repeat-end>
                <span class="positive">  Delivered on  </span>
              </div>
            </div>
            <!--<label class="item item-input">
              <textarea placeholder="Enter Your Message"></textarea>
            </label>-->
          </div>
        </ion-content>
        
        
        <ion-footer-bar align-title="left" class="bar-positive">
          <label class="item item-input" style="width:80%">
	          <input type="text" placeholder="Type your message!">
          </label>
          <button id="sendMessage" class="button button-small" style="width:18%">
            <i class="ion-android-send"></i> Send 
          </button>
          <button id="attachment" class="button button-small" style="width:2%">
            <i class="ion-android-add"></i> 
          </button>
        </ion-footer-bar>
        
      </ion-view>
    </script>
    
  </body>
</html>
            
          
!
            
              body {
  cursor: url('https://ionicframework.com/img/finger.png'), auto;
}

@media (min-width: 767px) {
  .menu-content {
    -webkit-transform: translate3d(270px, 0px, 0px) !important;
    width: calc(100% - 270px) !important;
  } 
  
  .bar-header button.ion-navicon {
    display: none;
  }
}


.messages {
	margin:0;
	padding:0;
	list-style-type:none;
}

.messages li {
	display:block;
	float:left;
	clear:both;
	max-width:65%;
	margin:0 0 1rem 0;
	padding:0;
}

.messages1 li:nth-child(even) {
	float:right;
}

.messages1 li:nth-child(even) img {
	float:right;
}

.messages p {
	border-radius:.75rem;
	background:#e6e5eb;
	color:#383641;
	padding:.6875rem;
	margin:0;
	font-size:.875rem;
}

.messages1 li:nth-child(even) p {
	background:#158ffe;
	color:#fff;
}

.messages img {
	display:block;
	max-width:65%;
	border-radius:.75rem;
}

.bold {
  font-weight: bold;
}

.pull-right {
  float:right !important;
}

.pull-left {
  float: left;
}

.messages-blue {
	background:#158ffe !important;
	color:#fff !important;
}
            
          
!
            
              angular.module('ionicApp', ['ionic', 'ionic.contrib.frostedGlass'])

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

  $stateProvider
    .state('eventmenu', {
      url: "/event",
      templateUrl: "event-menu.html"
    })
    .state('eventmenu.home', {
      url: "/home",
      views: {
        'menuContent' :{
          templateUrl: "home.html"
        }
      }
    })
    .state('eventmenu.list', {
      url: "/list",
      controller: 'MainCtrl',
      views: {
        'menuContent' :{
          templateUrl: "list.html"
        }
      }
    })
    .state('eventmenu.note', {
        url: "/note",
        views: {
          'menuContent' :{
            templateUrl: "note.html"
          }
        }
      })
   .state('eventmenu.new', {
        url: "/new",
        views: {
          'menuContent' :{
            templateUrl: "new.html"
          }
        }
      });
  
  $urlRouterProvider.otherwise("/event/list");
})

.controller('MainCtrl', function($scope, $ionicSideMenuDelegate, $http) {
  $scope.attendees = [
    { firstname: 'Nicolas', lastname: 'Cage' },
    { firstname: 'Jean-Claude', lastname: 'Van Damme' },
    { firstname: 'Keanu', lastname: 'Reeves' },
    { firstname: 'Steven', lastname: 'Seagal' }
  ];
  
  $http.get('https://sanskar-test.appspot.com/meta-mobile/student/8367/subject/teachers?access_token=ya29.1.AADtN_V2TIuqWXyYas4QRu94i-SqA5HhW-ljOsi5Ji52MAac4iU0BOP64N9D248').success(function(data) {
    alert(JSON.stringify(data));
  })
})

.controller('PageCtrl', function($scope, $ionicFrostedDelegate, $ionicScrollDelegate, $rootScope) {
  $scope.myDate = new Date();
  $scope.currentUser = 'Viz';
  var messageOptions = [
    { content: 'Hi.', user: 'T1' },
    { content: 'Hello P', user: 'Viz'  },
    { content: 'Chat 1', user: 'T1'  },
    { content: 'Chat 2P', user: 'Viz'  },
    { content: 'Chat 3', user: 'T1'  },
    { content: 'Chat 4P', user: 'Viz'  },
    { content: 'Chat 5', user: 'T1'  },
    { content: 'Chat 6', user: 'T1'  },
    { content: 'Chat 7P', user: 'Viz'  },
  ];
 
  var messageIter = 0;
  $scope.messages = messageOptions.slice(0, 2);

  $scope.add = function(message) {
    var nextMessage = message;
    if(!message) {
      nextMessage = messageOptions[messageIter++ % messageOptions.length];
    }
    
    $scope.messages.push(angular.extend({}, nextMessage));

    // Update the scroll area and tell the frosted glass to redraw itself
    //$ionicFrostedDelegate.update();
    $ionicScrollDelegate.scrollBottom(true);
  };
});

            
          
!
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