mirror of https://github.com/abpframework/abp.git
13 changed files with 41 additions and 19 deletions
@ -0,0 +1,15 @@ |
|||
import { Directive, ElementRef, Input, AfterViewInit } from '@angular/core'; |
|||
|
|||
@Directive({ |
|||
selector: '[autofocus]', |
|||
}) |
|||
export class AutofocusDirective implements AfterViewInit { |
|||
@Input('autofocus') |
|||
delay: number = 0; |
|||
|
|||
constructor(private elRef: ElementRef) {} |
|||
|
|||
ngAfterViewInit(): void { |
|||
setTimeout(() => this.elRef.nativeElement.focus(), this.delay); |
|||
} |
|||
} |
|||
@ -1,3 +1,4 @@ |
|||
export * from './autofocus.directive'; |
|||
export * from './ellipsis.directive'; |
|||
export * from './permission.directive'; |
|||
export * from './visibility.directive'; |
|||
|
|||
Loading…
Reference in new issue