What does #id in input tag mean?

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

From this Angular.io tutorial, I show:


where I do not unde

6条回答
  •  时光说笑
    2021-01-18 11:43

    In simple words:

    1. Its called a template reference variable (aka reference variable) since it is declared in template and often consumed in Javascript(typescript).

    2. A template reference variable is similar to var id(but not identical) which can be used to refer pretty much any DOM element (HTML element, Directive, Component) in template.

    3. Template Reference variable are also available in Reactjs.

    4. In angular you can use #somename or ref-somename to declare a template reference variable.

    So how do i use these TRV(Template Reference variable) that's when you should look into library documentation

提交回复
热议问题