Input with *ngIf
using *ngIf to show/hide only the input, but not the ngx-mat-timepicker
Before v 9.0.3, inputs weren't detached when destroyed, so you needed to destroy the ngx-mat-timepicker as well. Not anymore.
ngx-mat-timepicker is here
<mat-form-field *ngIf="showInput">
<input matInput
name="selected_time"
[format]="24"
[(ngModel)]="selectedTimes.C"
[ngxMatTimepicker]="pickerC"
placeholder="12:00"
readonly />
<mat-icon matSuffix
(click)="pickerC.open()">
watch_later
</mat-icon>
</mat-form-field>
<button mat-raised-button
(click)="showInput = !showInput"
color="primary">
Destroy input
</button>
<div class="ngx-mtp-box-bordered">
<small>ngx-mat-timepicker is here</small>
<ngx-mat-timepicker color="accent"
#pickerC></ngx-mat-timepicker>
</div>