Ionic ng-click event not working on android


#1

Hi

I have the following code and it seems the ng-click event is not working on my android device, it works in my standard chrome.

Please let me know any additional information you might need or any tests I can carry out. I have also done this test on a simple button which doesn’t work either :frowning: :

Regards,
Brandon


#2

Where is the code? Can you post it up…


#4

The version of Ionic I am using:
{
“version”: “1.0.0-beta.13”,
“codename”: “lanthanum-leopard”,
“date”: “2014-09-24”,
“time”: “20:17:36”
}

My phone is running android 4.4.2, Romed HTC One M8 - running ViperROM 1.8.0


#5

Hi

Ok so I found out it actually isn’t the ng-click event, instead it is the modal that is not showing on the phone. Other click events work. below is the sample code of my modal:

Modal:

<ion-modal-view>
  	<ion-content>
  		<h1>Full Image</h1>
	</ion-content>
</ion-modal-view>

Controller:

   $ionicModal.fromTemplateUrl('../templates/common/image-viewer.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();
    	};
    	
    	$scope.$on('$destroy', function() {
        $scope.modal.remove();
    	});
    	
    	$scope.$on('modal.hidden', function() {
      	// Execute action
    	});
    	$scope.$on('modal.removed', function() {
      	// Execute action
    	});

#6

Hi

I have resolved this, it was a simple problem on my side, I will put my mistake here for anyone who runs into this in the future.

I changed

$ionicModal.fromTemplateUrl('../templates/common/image-viewer.html'

to

$ionicModal.fromTemplateUrl('templates/common/image-viewer.html'

As when I added some debug code I could see that Android was throwing a 404 when trying to load the template file

Regards,
Brandon