Pass variable in * ngIf

1

I have a variable in my input.component.ts called validacaoExterna , which gets a string from whoever uses 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 is not working. I would like to know how I can use this variable inside this * ngIf , it takes the error value in the input + that variable input.erro.validacaoExterna

    
asked by anonymous 06.04.2018 / 16:01

1 answer

0
 *ngIf="input.errors[validacaoExterna] && (input.dirty || input.touched)"
    
06.04.2018 / 19:41