Angular: Reference variable in templates

Inside templates:
<input type="text" #name>
<input type="text" #surname>
<button (click)="someMethod(name,surname)">Test</button>
Inside component:
import {ViewChild, ElementRef} from '@angular/core';
// ...
@ViewChild('name') nameRef: ElementRef;