I have a snippit as follows to try to pass a property down to a child element as follows:
<dom-repeat items="{{employees}}" as="employee">
<template>
<child-element employee={{employee}}> </child-element>
</template>
</dom-repeat>
Where employee is of type array (taken from the Polymer tutorial).
employees: {
type: Array,
notify: true,
value() {
return [
{first: 'Bob', last: 'Smith'},
{first: 'Sally', last: 'Johnson'},
];
}
In my child element, I'm just attempting to print out the passed down property:
<div> <span> {{employee}} </span> </div>
where employee is defined as a
employee: {
type: String,
notify: true,
value: "",
},
However, the values are not passed down when I try to print them out. If I change the value of employee to something else, it gets printed. Why is that? I cannot figure out why that property isn't passed down?
Thank you.
Turns out it does work. The problem might have been passing down the entire object to the child element. Changed to only passing the String: