Tracking first click only in Angular

I have tracking on my button that tracks every time it has been clicked. How do I get this to work so that the tracking call gets called only on the first click and no other clicks. Any help on this would be greatly appreciated.

.TS File

public reset(): void {
   this.myTrackingService.submitAnalyticsCall(new MyAnalyticsModel(
        APP-CONSTANTS.destination.myaccount));
}

HTML

<div *ngIf="showMyFilter" class="my-filter--container">
<my-filter(selectReset)="onReset()"></my-filter></div>

13 thoughts on “Tracking first click only in Angular”

Leave a Comment