0

From official documentation : passing model from donejs Child component to Parent component model

I have included search filter component in my homepage component and another product table component which is to be updated when the filters change.

HomePage Comp(stache file) :

<can-import from="../searchFilter">
  <searchfilter {^filter-list}="*filters" />
</can-import>

How to access this "*filters" in the homepage component js file? I have already tried : since * filters is an array, if i pass it as a custom data attribute, it becomes "[object][object]".

1 Answers1

0

The correct way to access the "*filters" property here was to send the property on the change of the component :

<can-import from="../status-searchFilter/" ($change)="update(*filters)">
    <status-searchfilter {^filter-List}="*filters"/>
</can-import>