Android ng-click does not trigger

Hi everyone! im having a little issue with ionic 2 (2.1.18). The ngclick event does not work with the android build, does not trigger.


    <button  ion-button block (click)="getMovies()">Search</button>

<ion-card *ngFor="let movie of foundmovies" (click)="goToDetails(movie)">
      <ion-col width-50><img onerror="this.src='./assets/img/default-movie.png'" src="{{movie.poster_path}}"/></ion-col>
      <ion-col width-50>
          {{ movie.original_title }}
        <h2><b>Release Date:</b> </h2>
        <p>{{ movie.release_date }}</p>
        <p>{{ movie.popularity }}</p>
        <p>{{ movie.vote_average }}</p>


import { Component } from ‘@angular/core’;
import { NavController, NavParams } from ‘ionic-angular’;
import { MovieDB } from ‘…/…/providers/movie-db’;
import { MyDetailsPage } from ‘…/my-details/my-details’;

selector: ‘page-my-home’,
templateUrl: ‘my-home.html’,
providers: [ MovieDB ]
export class MyHomePage {
public name;
public foundmovies;
public adult;
public pages;
public nextPageint = 2;
constructor(public navCtrl: NavController, public navParams: NavParams, private moviedb: MovieDB) {}

ionViewDidLoad() {


data => {
let temp = data.json();
this.pages = temp.total_pages;
this.nextPageint = 2;
this.foundmovies = temp[‘results’];
err => {



this.navCtrl.push(MyDetailsPage,{ movie: movie})


if(this.nextPageint < this.pages){
    data => {
      let temp = data.json();
      for(let i = 0; i<temp['results'].length; i++){
    err =>{
    () =>{


You have two click interactions in your sample. Which one is failing? But deeper still, how do you know it is failing? Have you looked at the console output? Did something else go wrong? Have you added a simple console.log(‘here’) type call before each function to see if it being called and it is other code that is failing?

Does it work with $ ionic serve?

yes in the ionic serve works perfect! but when a got the apk from android build the first button (Search) does nothing… but in the browser works perfect… even in the ionic view works perfect

Does the event not fire at all or isn’t the function performed? I.e. if you log the click inside goToDetails, does your Android build get in there at all?

And let me guess, there is a call to an external service to get your data within that provider?

If so, you are probably encountering Whitelisting issues, that will only surface once you run on a real device.

Ionic View is set up to allow everything to be accessed, thus it works.

You are right im using an external service… i read something about whitelist plugin of cordova… is that the solution?

Most likely. Trace down your code to see where it stops. What does the JavaScript console say? Probably returning 401 or preflight issues.

It was a whitelist problem! i added a cordova whitelist plugin plus a header and now works perfect!! thanks a lot!