Here is an template example:
Here b
The main thing to understand it the following:
Interpolation is a special syntax that Angular converts into property binding. It’s a convenient alternative to property binding.
This implies that under the hood it yields a similar outcome. However, string interpolation has one important limitation. This is that everything within string interpolation will first be evaluated (trying to find a value from the model ts file):
This has some implications on how you can use the 2 methods. For example:
String concatenation with string interpolation:
String interpolation cannot be used for anything else than strings
When myInput
is an @Input()
of myComponent
and we want to pass in an object, we have to use property binding. If we were to use string interpolation the object would be turned into a string and this would be passed in as a value for myInput
.