Bindings

Binding types - by the direction of data flow

Binding types can be grouped into three categories distinguished by the direction of data flow:

  • source-to-view ( [ ], bind- )

  • view-to-source ( (), on- )

  • view-to-source-to-view ( [()], bindon- )

The target name is the name of a property. It may look like the name of an attribute but it never is.

Binding Types - Target

HTML attributes & DOM properties

Attributes are defined by HTML. Properties are defined by the DOM (Document Object Model).

  • A few HTML attributes have 1:1 mapping to properties. id is one example.

  • Some HTML attributes don't have corresponding properties. colspan is one example.

  • Some DOM properties don't have corresponding attributes. textContent is one example.

  • Many HTML attributes appear to map to properties

HTML Attributes initialize DOM properties and then they are done. DOM Property values can change; HTML attribute values can't.

Last updated

Was this helpful?