These are chat archives for canjs/canjs

Mar 2017
Mar 01 2017 17:58
I'm trying to use this code but it doesn't work: {(list)}="fields parentId"
fields is a function on the viewModel and parentId is a parameter I want to pass to that function
what's the right way to do this?
Kevin Phillips
Mar 01 2017 18:27
Kevin Phillips
Mar 01 2017 18:36
the way you had it should work also, except that parentId would be a compute and not the actual value
which is probably not what you want
Mar 01 2017 18:58
thanks @phillipskevin
Kevin Phillips
Mar 01 2017 19:00
:thumbsup: no problem!
Viktor Busko
Mar 01 2017 20:01

guys, I have a component's viewModel that contains object with an array of objects. So it's like

period: {
    prop1: ...,
    prop2: ...,
    myList: [

Define plugin automatically converts 'period' to can.Map, 'myList' to can.List, and its items to another can.Maps.
Is there a good way to 'Define' behavior of inner maps ? (elements of 'myList').
Basically I need to do some formatting and get/set in Define might be useful.

Chasen Le Hara
Mar 01 2017 21:32
Hi @Lighttree, it looks like you’re using CanJS 2, is that correct?
You can create a can.List type and then set its Map type so objects get converted into specific types:
That’s a little confusing so if it doesn’t make sense, you could create a JS Bin with your view model and we can provide some advice. 🙂
Here’s a JS Bin for CanJS 2:,js,output