The IPHistoryModelDirective is used to trigger detectChanges on EmailBuilderHistoryHostDirective whenever a form control value is changed.
The selector for this directive is:
ngControl?: NgControl: The host control element to watch.
historyHostDirective?: EmailBuilderHistoryHostDirective: The history host element.
ngOnInit(): void: Angular lifecycle method. Subscribes to changes on the
ngControlvalue and triggers the
detectChangesmethod on the
ngOnDestroy(): void: Angular lifecycle method. Cleans up any subscriptions made during the component's lifecycle.
IPHistoryModelDirectivedirective is used to track changes made to a form control and add them to the history manager.
To use the directive, add the
[ipHistoryModel]attribute to the form control element and provide a
EmailBuilderHistoryHostDirectiveinstance to the
<input type="text" [(ngModel)]="myValue" [ipHistoryModel]="historyHostDirective" />
<!-- Add this directive to a parent element of the form -->
<div ipEmailBuilderHistoryHost #historyHostDirective="ipEmailBuilderHistoryHost">