could you please tell me why click event not work when loader is display on click .Actually I created a situation when I am getting data too late and try to move from this situation (try to move next page but of loader is present on screen user not able to click any button on screen ) .Please click my code pen .When loader is display user not able to click on button .Mean I am not able to show alert on button click here is my code http://codepen.io/anon/pen/mJXXZY
when I click alert is not display
angular.module('ionicApp', ['ionic'])
.controller('AppCtrl', function($scope, $timeout, $ionicLoading) {
$scope.cll=function(){
alert("---")
}
// Setup the loader
$ionicLoading.show({
content: 'Loading',
animation: 'fade-in',
showBackdrop: false,
maxWidth: 200,
showDelay: 0
});
// Set a timeout to clear loader, however you would actually call the $ionicLoading.hide(); method whenever everything is ready or loaded.
$timeout(function () {
$ionicLoading.hide();
$scope.stooges = [{name: 'Moe'}, {name: 'Larry'}, {name: 'Curly'}];
}, 1000000);
});
You had a spelling error ng-clil instead of ng-click and when you call a function you need (); Here is your code fixed: Also you wont be able to click while the ionic loader is showing. Working code pen: http://codepen.io/anon/pen/zGRWpm
HTML:
<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 Modal</title>
<link href="http://code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
<script src="http://code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
</head>
<body ng-controller="AppCtrl">
<ion-view title="Home">
<ion-header-bar>
<h1 class="title">The Stooges</h1>
</ion-header-bar>
<ion-content has-header="true">
<button ng-click="cll()">click button</button>
<ion-list>
<ion-item ng-repeat="stooge in stooges" href="#">{{stooge.name}}</ion-item>
</ion-list>
</ion-content>
</ion-view>
</body>
</html>