What does #id in input tag mean?

前端 未结 6 1199
挽巷
挽巷 2021-01-18 10:56

From this Angular.io tutorial, I show:


where I do not unde

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-18 11:52

    This is template reference variable they are usually declared #variable and can be used anywhere in the template.

    In this particular scenario #searchBox is declare the variable which will store the value of whatever is entered in textbox.

    Moreover you can also see the use of this template variable #searchBox in keyup function were it is used to read the value itself. In same way you can use this variable anywhere in your code.

提交回复
热议问题