pdnsmanager/frontend/src/app/utils/Focus.directive.ts

15 lines
309 B
TypeScript
Raw Normal View History

2018-04-08 14:30:00 +02:00
import { Directive, AfterViewInit, ElementRef } from '@angular/core';
@Directive({
selector: '[appFocus]'
})
export class FocusDirective implements AfterViewInit {
constructor(private elementRef: ElementRef) { }
ngAfterViewInit(): void {
this.elementRef.nativeElement.focus();
}
}