Posts

Showing posts with the label Syntax of Property Binding

Angular 4.0 : What is Angular Property Binding?

Image
Angular Property Binding What is Angular Property Binding? It is one way data binding like interpolation. It is used to bind values to the DOM properties of the HTML elements.  One Way Data-Binding   From Component     →       View Template  In the Angular for property binding we used square brackets: [] Let us take an example of Property binding and interpolation:-  In this an example, I have taken html image tag and set its properties like src, height and width.  Syntax of  Property Binding:- <b>Property Binding Example</b><br /><br /> <img [src]='PropertyBindingImagePath' [height]=ImgHeight [width]=ImgWidth /> Syntax of  Interpolation:- <b>Interpolation Example</b><br /><br /> <img src='{{interpolationImagePath}}' height={{ImgHeight}} width={{ImgWidth}} /> Output Both are showing the sam...