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 ngControl value and triggers the detectChanges method on the historyHostDirective.
  • 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:
<input type="text" [(ngModel)]="myValue" [ipHistoryModel]="historyHostDirective" />
<!-- Add this directive to a parent element of the form -->
<div ipEmailBuilderHistoryHost #historyHostDirective="ipEmailBuilderHistoryHost">