What is the use of Angular 2 hashtags in template ? Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report Angular2 hashtag is a syntax used to declare DOM element as variable and these templates render as an HTML file. #: variable declaration(): event binding[]: property binding[()]: two-way property binding{{}}: interpolation Template reference variables are a little gem that allows getting a lot of nice things done with Angular. It relies on a simple hashtag to create a reference to an element in a template.Syntax: <input #searchBox keyword="search(searchBox.value)"> In above syntax, it creates reference to the input element that can be used later in the templates.Example: javascript import {Component} from 'angular2/core'; @Component({ selector: 'pv-app', templateUrl: 'components/harry/hello.component.html' }) export class pvApp {}import {Component} from 'angular2/core'; @Component({ selector: 'pv-app', templateUrl: 'components/pv/hello.component.html' }) export class pvApp {} <input type="text" #pv> {{ pv.value }} In above example, pv refers to HTML element object instance for input. So, pv has all the properties and methods of HTML Elements. (id, name, etc.) Comment More infoAdvertise with us Next Article What is the meaning of let-* in Angular 2 Templates ? P priyankvamja2000 Follow Improve Article Tags : Web Technologies AngularJS AngularJS-Misc Similar Reads What is the meaning of let-* in Angular 2 Templates ? The let keyword in Angular declares a template input variable that is referenced within the template. In Angular, the micro syntax is used to configure a directive in a compact and friendly string. It is a capability given in angular to embed the variables in the template directly by translating tha 3 min read What is the meaning of let-* in Angular 2 Templates ? The let keyword in Angular declares a template input variable that is referenced within the template. In Angular, the micro syntax is used to configure a directive in a compact and friendly string. It is a capability given in angular to embed the variables in the template directly by translating tha 3 min read What are templates in AngularJS ? Templates in AngularJS are simply HTML files filled or enriched with AngularJS stuff like attributes and directives. A directive is a marker element that is used to target a particular attribute or class to render its behavior according to the needs. Model and controller in Angular are combined with 3 min read What are templates in AngularJS ? Templates in AngularJS are simply HTML files filled or enriched with AngularJS stuff like attributes and directives. A directive is a marker element that is used to target a particular attribute or class to render its behavior according to the needs. Model and controller in Angular are combined with 3 min read What is Interpolation in AngularJS ? In this article, we will know about Interpolation in AngularJS, along with understanding the basic implementation. In AngularJS, Interpolation is a way to transfer the data from a TypeScript code to an HTML template (view), i.e. it is a method by which we can put an expression in between some text a 2 min read Angular PrimeNG Messages Templates Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will learn about Angular PrimeNG Messages Templates The messages component is us 3 min read Like