Skip to content

Commit

Permalink
Adding timeStamp when emitting change (#1052)
Browse files Browse the repository at this point in the history
  • Loading branch information
jogaj authored Sep 18, 2024
1 parent 25b999a commit bfc197d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions projects/swimlane/ngx-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## HEAD (unreleased)

- Enhancement (`ngx-toggle`): Added `timeStamp` when emiting `change`
- Enhancement (`ngx-checkbox`): Added `timeStamp` when emiting `change`

## 48.0.3 (2024-09-17)

- Enhancement (`ngx-toggle`): Added `change` output to align with `ngx-checkbox`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ export class CheckboxComponent implements ControlValueAccessor {
};

private emitChange() {
this.change.emit({ stopPropagation: () => {}, target: { checked: this._value } } as any);
this.change.emit({
stopPropagation: () => {},
timeStamp: new CustomEvent('change').timeStamp,
target: { checked: this._value }
} as any);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ export class ToggleComponent implements ControlValueAccessor {
};

private emitChange() {
this.change.emit({ stopPropagation: () => {}, target: { checked: this._value } } as any);
this.change.emit({
stopPropagation: () => {},
timeStamp: new CustomEvent('change').timeStamp,
target: { checked: this._value }
} as any);
}
}

0 comments on commit bfc197d

Please sign in to comment.