I can't figure out how to give a component a reference to its view, to do things like focus on input elements when the form is shown. I can't appear to inject
What you are looking for is probably
ElementRef and its
nativeElement field, but you should avoid accessing the DOM this way.
I think a better way is to add a template variable like
<input #inp> and the access it with
@ViewChild('inp') input. In
input references the input element.