JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.ionicframework.com/1.0.0-beta.13/js/ionic.bundle.js"></script>
<link rel="stylesheet" href="http://code.ionicframework.com/1.0.0-beta.13/css/ionic.css">
<div><div ng-app="testApp">
<button class="button" ng-click="openModal()" ng-controller="MyController">Open Modal</button>
<script id="my-modal.html" type="text/ng-template">
<ion-modal-view>
<ion-header-bar>
<h1 class="title">My Modal title</h1>
</ion-header-bar>
<ion-content ng-controller="ModalController">
<button class="button button-calm" ng-click="showAlert()">Alert!</button>
</ion-content>
</ion-modal-view>
</script>
</div></div>
JavaScript
angular.module('testApp', ['ionic'])
.controller('MyController', function($scope, $ionicModal) {
$ionicModal.fromTemplateUrl('my-modal.html', {
scope: $scope,
animation: 'slide-in-up'
}).then(function(modal) {
$scope.modal = modal;
});
$scope.openModal = function() {
$scope.modal.show();
};
$scope.closeModal = function() {
$scope.modal.hide();
};
//Cleanup the modal when we're done with it!
$scope.$on('$destroy', function() {
$scope.modal.remove();
});
}).controller("ModalController", function($scope){
$scope.showAlert = function(){ alert("I'm a modal window!") }
})