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

268
Visualizações
Angular2 - Supplied parameters do not match any signature of call target
import { Component, Input, OnChanges } from '@angular/core';

@Component({
  selector: 'image-display',
  templateUrl: './image-display.component.html'
})
export class ImageDisplayComponent implements OnChanges {
  @Input() image: File;
  @Input() imagePath?: string;

  private fileReader: FileReader;

  constructor() { }

  ngOnChanges() {
    if (this.image && this.fileReader) {
      this.fileReader.readAsDataURL(this.image);
    }
  }
}

On compiling this with AOT getting below error:

PRINHYLTPAP0592:matata ajays$ ng build --prod --aot
/myApp/src/$$_gendir/app/image-uploader/image-display/image-display.component.ngfactory.ts (61,9): 
Supplied parameters do not match any signature of call target.
over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

AOT forces you to inform every single mandatory parameter for every method call.

In your example, the method ngOnChanges() should actually be ngOnChanges(changes: SimpleChanges).

over 4 years ago · Santiago Trujillo Relatório

0

please provide code of image-display.component.html file. it might be the variable on the template is not initialized onto the component. Check all the variables you used on the template if they are exists on ImageDisplayComponent.

over 4 years ago · Santiago Trujillo Relatório

0

If there is any mismatch between method which is called from html, and the definition of the method in the component, we see this error.

mostly mismatch in the number of parameters passed to the method while calling.

I was passing $event in onModelChange method, which is not decalared in the method definition.

dropdownChanged(){
  console.log("dropdown changed");
}
dropdownChangedActual(evnt:any){
  console.log("dropdown changed");
}
<select [(ngModel)]="myModel" (ngModelChange)="dropdownChanged($event)">
     <option>.............</option>
</select>

Either declare $event or any parameters we pass or Pass the parameters as mentioned in method definition.

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