📜  属性绑定和插值之间的区别 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:12.102000             🧑  作者: Mango

代码示例1
Interpolation uses the {{ expression }} to render the bound value to the component’s template. Interpolation is a special syntax that Angular converts into a property binding

Property binding uses [] to send values from the component to the template. Property Binding: to set an element property to a non-string data value, you must use property binding

Example :

we are disabling a button by binding to the Boolean property isDisabled.


interpolation instead of property binding, the button will always be disabled irrespective of isDisabled class property value is true of false.


canonical form which is an alternate syntax to square bracket.