Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Directive, ElementRef, OnInit } from '@angular/core';
- @Directive({
- selector: '[getfocus]',
- })
- export class AutofocusDirective implements OnInit{
- constructor(private el: ElementRef) {
- }
- ngOnInit(){
- this.el.nativeElement.focus();
- console.log('focused', this.el.nativeElement);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement