Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

216
Visualizações
click event doesn't work, "co.console.log() is not a function"

I've been trying to get a button to work to bring up a page, passing an object in the parameters, but for some reason, it gives me the error

"co. is not a function."

I don't know what the problem is because it gives me the same error when I try to use alert or console.log, or anything.

page HTML:

<ion-header>

   <ion-navbar>
       <ion-title>SearchResults</ion-title>
   </ion-navbar>

</ion-header>


<ion-content padding>
    <ion-list>
        <ion-item *ngFor= "let item of resultArray;">
            <img src={{item.thumbnail}} />
            <p>{{item.title}}</p>
            <button bookDetail (click)="console.log(\"Even some text, please?\")">DETAIL</button>
        </ion-item>
    </ion-list>
</ion-content>
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

On your ts file just do like below.

.ts

log():void {
 console.log('Your message here');
}

html

<button ion-button (click)="log()">DETAIL</button>

Note: If you need to pass the item then just do like this log(item) on html side and ts side log(data):void {}.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda