Hello,
I am trying to create a dynamic form that hides and shows one input at a time.
I would like to be able to jump to the next input when the ngIf doesnt hide it anymore. So far I have found this directive :
import { Directive, AfterViewInit, ElementRef } from '@angular/core';
@Directive({
selector: '[directFocus]'
})
export class AutofocusDirective implements AfterViewInit {
constructor(private elementRef: ElementRef) { };
ngAfterViewInit(): void {
this.elementRef.nativeElement.focus();
}
}
But it doesn’t work … Has anyone come past such a problem ?
Thank you,