You should go with Angular Docs again.
Angular docs on property binding
In case you need some explanation.
Data bound properties are simple attributes in HTML template which you are binding with property in your component. The very basic of this is interpolation where you can use {{property}}
. The binding sets the property to the value of a template expression.
let say you have a property yourImageUrl
in your component then you can use this with src
to assign the value to src
. [property]
is one way bound because u can only set this.
<img [src]="yourImageUrl">
you can also use One-time string initialization if you know your value will never change.
If you want your component to getValue from your template then you need to use two way binding or event binding then you need to use something like [(property)]
.