<div class="inputgroup">

    <label *ngIf="haslabel" role="input" id="{{componentId}}"  for="{{componentId}}" [style.font-style]="fontstyle" [style.font-family]="fontfamily" [style.font-size]="fontsize">
      {{fieldlabel}}
      <ng-container *ngIf="(fieldlabel != '' && !allowblank && iconfeedback); else elseblock">
        <span style="color: red">*</span>
        <ng-template #elseBlock>
          <span></span>
        </ng-template>
      </ng-container>
      
  </label>
    <input type="text" 
    autocomplete="off"
        role="text" 
        tabindex="1"
        id="{{componentId}}" 
        name="textID"
        attr.aria-labelledby="{{componentId}}"
        aria-describedby="textDec"
        [attr.aria-required]="!allowblank"
        [attr.aria-invalid]="!isValid "
         class="input-control" 
        [ngClass]="model.touched ? allowblank ? '' : (isValid && model.touched) ? 'input-control-success' : 'input-control-error' :''" 
        [(ngModel)]="value"
        (blur)="onBlurEvent()" 
        (focus)="onFocusEvent($event)" 
        (input)="onInputTextEvent($event)"
        (change)="onChangeEvent($event)"
        [name]="name" 
        [pattern]="regEx" 
        [attr.placeholder]="placeholder" 
        [maxlength]="maxlength" 
        [minlength]="minlength" 
        [attr.disabled]="disabled ? true: null"
        [attr.readonly]="readonly ? true: null"
        [required]="!allowblank" />

    <ng-container *ngIf="iconfeedback">
        <span class="input-control-feedback">
          <span *ngIf="!isValid && model.touched"><em class="fa fa-times"></em></span>
        <span *ngIf="isValid && model.touched"><em class="fa fa-check"></em></span>
        </span>
    </ng-container>

      <input-help *ngIf="showToolTip && enablepopover" 

      id="textDec"
      role="tooltip"

      [error-msg]="errormsg" 
      [max-error-msg]="maxerrormsg"
      [min-error-msg]="minerrormsg"
      [min-length]="minlength"
      [max-length]="maxlength">
      </input-help>
   
    <span class="inputfieldbar"></span>
</div>