Hi ,
I started to learn Ionic development and facing issue with Modal.
My settings modal is not closing. Could any one look at the code and suggest the solution.
index.html
< ion-pane >
< div ng-app=“settings” ng-controller=“con-Set”>
< ion-header-bar class=“bar bar-assertive” >
< h1 class=“title”>Home
< button ng-click=“showSettings()” class=“button button-icon”>< /button>
< /ion-header-bar>
< /div>
< button class=“button button-clear”>Left
< div class=“title”>Title
< button class="button button-clear ">Right
< /div>
< /ion-pane>
settings.html
< html >
< head>
< /head>
< body ng-app=“settings” ng-controller=“con-Set”>
< ion-header-bar class=“bar bar-header bar-dark”>
< h1 class=“title”>Settings
< button class=“button button-clear” ng-click=“closeModal()”>Close
< /ion-header-bar>
< ion-content class=“has-header”>
< /ion-content>
< /body>
< /html>
settings.js
angular.module(‘settings’, [‘ionic’])
.controller('con-Set', function($scope,$location,$ionicModal) {
$ionicModal.fromTemplateUrl('settings.html', function(modal) {
$scope.modal = modal;
},{
animation: 'slide-in-up'
});
$scope.showSettings = function(){
$scope.modal.show();
};
$scope.closeModal = function() {
//console.log('Closing modal');
$scope.modal.hide();
};
});