mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
Move to libs
This commit is contained in:
12
libs/angular/src/directives/input-strip-spaces.directive.ts
Normal file
12
libs/angular/src/directives/input-strip-spaces.directive.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Directive, ElementRef, HostListener } from "@angular/core";
|
||||
|
||||
@Directive({
|
||||
selector: "input[appInputStripSpaces]",
|
||||
})
|
||||
export class InputStripSpacesDirective {
|
||||
constructor(private el: ElementRef<HTMLInputElement>) {}
|
||||
|
||||
@HostListener("input") onInput() {
|
||||
this.el.nativeElement.value = this.el.nativeElement.value.replace(/ /g, "");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user