In my application, there are multiple forms and each forms having so many input field. for the same, I have created a template-driven component for multiple time use but I am not able to pass dynamically validation directive at time of calling component.
<div class="{{ _divTag.divClass }}" id="{{ _divTag.divId }}">
<label for="{{ _inputTag.inputId }}" class="{{ _lableTag.labelClass }}">{{
_lableTag.labelTitle
}}</label>
<input id="{{ _inputTag.inputId }}" class="{{ _inputTag.inputClass }}" type="{{ _inputTag.inputType }}"
name="{{ _inputTag.inputName }}" placeholder="{{ _inputTag.inputPlaceholder }}" [(ngModel)]="modelValue" />
</div>
<erp-input-control [_lableTag]="{ labelClass: 'lbl', labelTitle: 'State Code' }" [_divTag]="{
divClass: 'col-sm-2 padding_left_0 pull-left',
divId: 'div_state_code'
}" [_inputTag]="{
inputId: 'state_code',
inputName: 'state_code',
inputClass: 'form-control',
inputPlaceholder: 'State Code',
inputType: 'text'
}" [_directive]="{ inputDirective: 'erpRequired' }"[(modelValue)]="_stateModel.state_code">
</erp-input-control>
In this case I want do validation [_directive]="{ inputDirective: 'erpRequired' }" but its not working.