These are chat archives for canjs/canjs

17th
Dec 2015
Chris Gomez
@akagomez
Dec 17 2015 16:47

Pre 2.3.X I had a parent <-> child component relationship. Something like this:

// parent.js

scope: {
  options: ['all', 'calls', 'voicemails', 'ims'],
  filterBy: 'all'
}
// parent.stache

<child-component 
  selected-option="{filterBy}" 
  options="{options}"></child-component>
// child.stache

Selected: {{selectedOption}}

<ul>
  {{#each options}}
    <li can-click="{selectOption}">{{.}}</li>
  {{/each}}
</ul>

After updating to 2.3.7 selectedOption will be updated when the user clicks an <li>, but filterBy will not. Do I have to change the syntax that I use to bind filterBy to selectedOption?

Matthew Phillips
@matthewp
Dec 17 2015 16:55
selectOption is a string?
oh, no it's not
is selectOption a function on the child's viewModel?
Chris Gomez
@akagomez
Dec 17 2015 16:59
@matthewp Yes. It basically does this.attr(‘selectedOption’, value).
Josh Dean
@imjoshdean
Dec 17 2015 17:04
@akagomez isolated
'{scope} value' doesn't trigger
but did in 2.2.9
Chris Gomez
@akagomez
Dec 17 2015 17:08
If you define an argument in get it seems to work.