assigning the property of a component in angular code example
Example: use property in angular 8
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = "Data binding using Property Binding";
imgUrl="https://static.javatpoint.com/tutorial/angular7/images/angular-7-logo.png";
}
<h2>{{ title }}</h2> <!-- String Interpolation -->
<img [src]="imgUrl" /> <!-- Property Binding -->