IPHistoryModelDirective
The IPHistoryModelDirective is used to trigger detectChanges on EmailBuilderHistoryHostDirective whenever a form control value is changed.
The selector for this directive is:
[ipHistoryModel]
ngControl?: NgControl
: The host control element to watch.historyHostDirective?: EmailBuilderHistoryHostDirective
: The history host element.
ngOnInit(): void
: Angular lifecycle method. Subscribes to changes on thengControl
value and triggers thedetectChanges
method on thehistoryHostDirective
.ngOnDestroy(): void
: Angular lifecycle method. Cleans up any subscriptions made during the component's lifecycle.
The
IPHistoryModelDirective
directive 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 EmailBuilderHistoryHostDirective
instance to the historyHostDirective
property.Usage example:
<form>
<input type="text" [(ngModel)]="myValue" [ipHistoryModel]="historyHostDirective" />
</form>
<!-- Add this directive to a parent element of the form -->
<div ipEmailBuilderHistoryHost #historyHostDirective="ipEmailBuilderHistoryHost">
...
</div>