Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Component({
- selector: 'trimmed-input'
- })
- class TrimmedInput {
- @HostBinding() value: string;
- @HostListener("input", "$event.target.value")
- onChange(updatedValue: string) {
- this.value = updatedValue.trim();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement