Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

360 B
Raw Blame
import { AfterViewInit, Directive, ElementRef, inject } from '@angular/core'

@Directive({
  selector: '[myAutofocus]',
  standalone: true
})
export class AutofocusDirective implements AfterViewInit {
  private host = inject(ElementRef)

  ngAfterViewInit () {
    const el = this.host.nativeElement as HTMLElement

    el.focus({ preventScroll: true })
  }
}