What is the difference between interpolation and property binding?

Angular components and templates · Freshers

Model answer

Interpolation puts a value into text: <p>Hello {{ name }}</p>. Property binding sets a DOM or component property: <img [src]="imageUrl">. Interpolation always turns the value into a string. Property binding keeps the real type, so you can pass objects, numbers or booleans, such as [disabled]="isBusy".

Use interpolation for text and property binding when setting properties and inputs.

Learn this topic

Angular Tutorial: Beginner to Advanced .

Sign in to add your own answer.

More questions