Show List

Property Binding

Property binding refers to setting the HTML element property using the TypeScript code data. It is one way data binding.

Syntax:
<element [property]= 'typescript_property'>

Examples:
<input [value]='titleProp'>
Here the value of titleProp is provided by TypeScript class.
<img [src]='srcProp'>
srcProp is provided by TypeScript class.
<button [disabled]='allowFlag' style="margin: 10px;">Show</button>
allowFlag is provided by TypeScript class.
<h3 [innerText]= "headerText"></h3>  
headerText is provided by TypeScript class.

    Leave a Comment


  • captcha text