mirror of https://github.com/abpframework/abp.git
2 changed files with 17 additions and 0 deletions
@ -0,0 +1,16 @@ |
|||||
|
import { Directive, ElementRef, Input, inject } from '@angular/core'; |
||||
|
|
||||
|
@Directive({ |
||||
|
standalone: true, |
||||
|
selector: '[abpShowPassword]', |
||||
|
}) |
||||
|
export class ShowPasswordDirective { |
||||
|
protected readonly elementRef = inject(ElementRef); |
||||
|
|
||||
|
@Input() set abpShowPassword(visible: boolean) { |
||||
|
const element = this.elementRef.nativeElement as HTMLInputElement; |
||||
|
if (!element) return; |
||||
|
|
||||
|
element.type = visible ? 'text' : 'password'; |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue