what is the type of a template referance variable passed as input?

Viewed 44

I do have following piece of (pseudo-) code

<some-component   #someComponent/>

<another-component [reference]="someComponent" />
@Component(...)
export class AnotherComponent {
 @Input() reference     // <--- type
}

My question now is: What is the type of the Input reference? I did not find anything in the docs. It is (as far as I can say) not an ElementRef. I do then want to access the nativeElement of the passed reference.

1 Answers

If it is always #someComponent, you could just use SomeComponentComponent or however your class is called. If it is dynamic, you could use TemplateRef<any>

Related