Wednesday, October 18, 2023

Attribute Binding in Angular Sample Example

 Please Refer to the previous example of mine. 

https://dotnetbyudayrajakonda.blogspot.com/2023/10/angular-event-binding.html


Attribute Binding:  Binding component variable to html Element is  called as Attribute Binding.

Syntax:

<tagname [attr.attributename]="varname" >

atrribute binding is required when html element attribute is not having corresponding DOM object property.


html element                                                     DOM


<input type="text"-------------------------> text box object

 value="..."                                                value property


td colspan="..."----------------------------->td[table data] obje

                                        no colspan property , so this required attribute binding






.html changes



output










No comments:

Post a Comment

Thank you for visiting my blog

Python -3

  Lists It is used to store Collection of data. Lists are created using square brackets: List Items Order cannot be changed. It can have dup...