Angular [2020] - Declare And Use String interpolation {{}}
- Forums
- Angular
- Angular [2020] - Declare And Use String interpolation {{}}
this is a very simple instructions on how to use string extrapolation in angular as of 2020. The double curly braces are Angular's interpolation binding syntax [4807], Last Updated: Mon Jun 24, 2024
angular2020
Sat May 02, 2020
0 Comments
481 Visits
To declare a string and use it in the component html file follow these steps. In this example, we are declaring the value of title.
- Declare the new value of title in app.component.ts inside the export class AppComponent { as such:
export class AppComponent {
title = 'Title at app.compoents.ts';
}
- Now you can use it string variable in the app.component.html file like this:
<h1>{{title}}</h1>
Thats it.