In Angular, String interpolation is used to
display dynamic data on HTML template (at user end). It facilitates you to make
changes on component.ts file and fetch data from there to HTML template
(component.html file).
import {Component} from '@angular/core';
@Component(
{selector: 'app-server',
templateUrl: 'server.component.html'})
export class ServerComponent {
serverID: number = 10;
serverStatus: string = 'Online';
}
Difference
between String interpolation and Property Binding
String
Interpolation is a special syntax which is converted to property binding by
Angular. It's a convenient alternative to property binding.
0 comments:
Post a Comment