mirror of
https://github.com/bitwarden/browser
synced 2025-12-30 23:23:52 +00:00
Adds standalone: false to all components since Angular is changing the default to true and we'd rather not have the angular PR change 300+ files.
21 lines
599 B
TypeScript
21 lines
599 B
TypeScript
// FIXME: Update this file to be type safe and remove this and next line
|
|
// @ts-strict-ignore
|
|
import { Directive, ElementRef, HostListener, Self } from "@angular/core";
|
|
import { NgControl } from "@angular/forms";
|
|
|
|
@Directive({
|
|
selector: "input[appInputStripSpaces]",
|
|
standalone: false,
|
|
})
|
|
export class InputStripSpacesDirective {
|
|
constructor(
|
|
private el: ElementRef<HTMLInputElement>,
|
|
@Self() private ngControl: NgControl,
|
|
) {}
|
|
|
|
@HostListener("input") onInput() {
|
|
const value = this.el.nativeElement.value.replace(/\s+/g, "");
|
|
this.ngControl.control.setValue(value);
|
|
}
|
|
}
|