What is # in ion input

Hi !

What is the interest of the # name in this example please ? <ion-input #inputPass>

may be it is used as ngModel for element.

@Quiesan That would make a variable representing your input that can be accessed in the template (Example: <some-component (tap)="inputPass.someMethod()">), and you also can use it to see your component with ViewChild in your ts file:

@ViewChild('inputPass') myInput: TextInput;

private someMethod() {

You can see more about it here: https://angular.io/guide/template-syntax#ref-vars

1 Like

Thank you very much !:slight_smile: