2
I have a variable in my input.component.ts
calling for validacaoExterna
, that receives a string from whoever is going to use it..
@Input() validacaoExterna: string;
In my input.component.html
I have a *ngIf that uses this variable
*ngIf="input.errors."{{validacaoExterna}}" && (input.dirty || input.touched)"
But this way is not working. I wonder how I can use this variable within this *ngIf, where it takes the error value in the input + this variable input.erro.validacaoExterna
tries thus *ngIf="input.errors[validatorExterna] && (input.Dirty || input.Touched)"
– Eduardo Vargas
The right and you save this expression in a variable and do *ngIf="variable" has as you show more code to try to understand the context
– Eduardo Vargas
It worked perfectly Eduardo, can mark as a response I give the OK here! Thank you very much.
– Guilherme Nunes