angular - what's wrong with my code No value accessor for form control with name: 'piscina' - Stack Over

admin2025-04-18  3

Template

<div style="margin-right:10px"><p-inputSwitch [(ngModel)]="parametrosPesquisa.piscina"
name="piscina"></p-inputSwitch></div>

Code

parametrosPesquisa: ParametroPesquisaImovel;

constructor(
    private googleCloudService: GoogleCloudService,
    private imoveisService: ImoveisService,
    private route: ActivatedRoute,
    private router: Router,
    private title: Title,
    private estadoAppServico: EstadoAppService,
    private armazenamentoLocalService: ArmazenamentoLocalService
) {
    this.parametrosPesquisa = new ParametroPesquisaImovel();
}

Class definition

export class ParametroPesquisaImovel {
    piscina: boolean;
    ...
}
转载请注明原文地址:http://anycun.com/QandA/1744965683a90136.html