<input {{field.validatorDirective}}
class="form-control"
[ngClass]="{ 'border-danger': hasErrors }"
(keyup)="callback()"
[formControlName]="field.key"
[id]="field.key"
[type]="field.type"
[placeholder]="field.placeholder"
[value]="field.value">
field
has all the content required but I'd like to dynamically add the directive name to be used.
It is currently added as a string
as field.validatorDirective
This has the error
TextComponent.html:2 ERROR DOM Exception: Failed to execute 'setAttribute' on 'Element': '{{field.validatorDirective}}' is not a valid attribute name.
My Directive has the selector usernameValidator