Property Binding with Angular

Binding the src property of an image:

Using bind- syntax:


Binding to the colSpan property

Column 1Column 2
Span 2 columns

Button disabled state bound to isUnchanged property:


Binding to a property of a directive

[ngClass] binding to the classes property making this blue


Model property of a custom component:

Pass objects:


Initialized string:


Property binding and interpolation

is the interpolated image.

is the property bound image.

"{{interpolationTitle}}" is the interpolated title.

"" is the property bound title.


Malicious content

"{{evilTitle}}" is the interpolated evil title.

"" is the property bound evil title.