Angular 19 Tutorial in Hindi #5 Interpolation
What is Interpolation
Examples of Interpolation
Limitations of Interpolation
Interview Questions
Display Data from TS to HTML file.
Execute JS code in HTML file
{{ }}
Limitations
Interpolation in Angular is a one-way data binding technique that allows you to display data from your component's TypeScript code within your HTML templates. It is a fundamental feature for creating dynamic and interactive user interfaces.
<h1>Interpolation in Angular</h1>
<h1>{{20+10}}</h1>
<h2>{{'hello'.toUpperCase()}}</h2>
<h3>{{10==10}}</h3>
<h1>{{data==data2}}</h1>
<h1>{{user1.toUpperCase()}}</h1>
<h1>{{user1==user2}}</h1>
<!-- <h1>{{data=3000}}</h1> -->
<!-- <h1>{{data3=3000}}</h1> -->
<!-- <h1>{{data2++}}</h1> -->
import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
@Component({
selector: 'app-root',
imports: [RouterOutlet],
templateUrl: './app.component.html',
styleUrl: './app.component.css'
})
export class AppComponent {
name="Anil Sidhu";
data=100;
data2=100;
user1="anil";
user2="anil";
}