How can I reset a custom form control with Angular
When resetting the form, all controls receive null in the writeValue method. I can then reset the durationControl like that:
writeValue(obj: any): void {
if (obj === null) {
this.durationControl.reset();
}
this.durationControl.setValue(obj, {
emitModelToViewChange: true
});
this.onChangeCallback(obj);
}