<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/nightly/css/ionic.min.css" rel="stylesheet">
    <script src="https://code.ionicframework.com/nightly/js/ionic.bundle.min.js"></script>
  </head>
  <body ng-controller="AppCtrl">
    
    <ion-header-bar type="bar-positive" title="'Contacts'" right-buttons="contactsRightButtons">
    </ion-header-bar>
    <ion-content has-header="true">
      
    </ion-content>
    
    <script id="modal.html" type="text/ng-template">
      <div class="modal" ng-controller="ModalCtrl">
        <header class="bar bar-header bar-positive">
          <h1 class="title">New Contact</h1>
          <button class="button button-clear button-primary" ng-click="modal.hide()">Cancel</button>
        </header>
        <ion-content has-header="true">
          Search: <input type="text" ng-model="searchState">
          <ion-list class="list">
 
            
      <label class="item item-radio" ng-model="contact" ng-repeat="contact in contacts | filter:searchState">
    <input type="radio" name="group">
    <div class="item-content">
   {{contact.name}}
    </div>
    <i class="radio-icon ion-checkmark"></i>
  </label>

            
            
          </ion-list>
        </ion-content>
      </div>
    </script>
    
  </body>
</html>
body {
  cursor: url('https://ionicframework.com/img/finger.png'), auto;
}
angular.module('ionicApp', ['ionic'])

.controller('AppCtrl', function($scope, $ionicModal) {
  
  $scope.contacts = [
    { name: 'Gordon Freeman' },
    { name: 'Barney Calhoun' },
    { name: 'Lamarr the Headcrab' },
  ];
  $scope.contactsRightButtons = [
    {
      type: 'button-icon ion-compose',
      tap: function(e) {
        $scope.modal.show();
      }
    }
  ];
  $ionicModal.fromTemplateUrl('modal.html', function(modal) {
    $scope.modal = modal;
  }, {
    animation: 'slide-in-up',
    focusFirstInput: true,
    scope: $scope
  });

})

.controller('ModalCtrl', function($scope) {
  
  $scope.newUser = {}; 
  
  $scope.createContact = function() {
    console.log('Create Contact', $scope.newUser);
    $scope.modal.hide();
  };
  
});
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.