I have a reactive form in angular 6 with material design components. How can I achieve to reuse some code (i.e. birthdate input field) in some other form? I don't want to copy & paste the HTML code between "< begin birthdate input component >" and "<- end birthdate input component ->" each time (see code below). I think ng-include does not work anymore and if I create a new angular 6 component the form and material design date field does not work.
<form [formGroup]="formGroupModel" (ngSubmit)="onSubmit()" novalidate>
<!-- begin birthdate input component -->
<div fxFlex="250px">
<mat-form-field>
<input matInput [matDatepicker]="geburtstagPicker" [min]="RangeValues.minValueGeburtstag" [max]="RangeValues.maxValueGeburtstag" placeholder="{{ 'Label_Geburtstag' | translate }}" formControlName="geburtstagControl" required (keyup)="geburtstagControl.valid ? parsedGeburtstagValue : parsedGeburtstagValue = null">
<mat-datepicker-toggle matSuffix [for]="geburtstagPicker"></mat-datepicker-toggle>
<mat-datepicker #geburtstagPicker></mat-datepicker>
</mat-form-field>
<div *ngIf="geburtstagControl.hasError('matDatepickerParse') && geburtstagControl.value != ''" class="alert alert-warning form-control-sm">
{{ 'DATE_IS_INVALID' | translate }}
</div>
<div *ngIf="geburtstagControl.hasError('matDatepickerMin') && geburtstagControl.value != ''" class="alert alert-warning form-control-sm">
{{ 'MIN_VALUE_ERROR' | translate }}: {{ RangeValues.minValueGeburtstag | date:format:'shortDate' }}
</div>
<div *ngIf="geburtstagControl.hasError('matDatepickerMax') && geburtstagControl.value != ''" class="alert alert-warning form-control-sm">
{{ 'MAX_VALUE_ERROR' | translate }}: {{ RangeValues.maxValueGeburtstag | date:format:'shortDate' }}
</div>
</div>
<!-- end birthdate input component -->
</form>