Objects
Binding attributes allow objects from one component to be passed into another.
In the following example, the my-page
component uses my-component
in it's template. The sourceProperty
property is passed into my-component's message
property using my-component's binding attribute wr-message
.
Property Reference
In the previous example, sourceProperty
was a primitive string value. In the example below, sourceProperty
is changed to an object with a single property sourceMessage
. The same value is passed into my-component
by setting the binding attribute wr-message
to sourceMessage
on sourceProperty
.
Object Reference
In the example below, rather than passing a single property on sourceProperty
into my-component
, the object itself is passed into my-component
.
The object can then be referenced in my-components' template using the local property message
.
Last updated