1import { Component } from '@angular/core';
2@Component({
3 selector: 'app-root',
4 templateUrl: './app.component.html',
5 styleUrls: ['./app.component.css']
6})
7export class AppComponent {
8 // this is property and you can use in your ts file
9 title = "Data binding using Property Binding";
10 imgUrl="https://static.javatpoint.com/tutorial/angular7/images/angular-7-logo.png";
11}
12
13// and this is your html code looks like
14
15<h2>{{ title }}</h2> <!-- String Interpolation -->
16<img [src]="imgUrl" /> <!-- Property Binding -->