These are chat archives for canjs/canjs

Oct 2018
Kevin Coleman
Oct 26 2018 14:47

Good morning folks. I've run into an issue where my view is not updating in response to a nested property on my ViewModel updating.

My view model has a property called data, which in turn has a property called posts. When the name value of a post updates, I would expect that to be updated in my view. Post and Data are both DefineMaps.

Now, if I put the post instance on the viewModel itself, everything works fine. It seems the intermediate data object could be an issue? Is there something I am missing in order to get updates to propagate up the chain to the view model from a nested object?
Justin Meyer
Oct 26 2018 15:25
@kcoleman731 should work out of the box

Contributors Meeting starting in 5 min:

Learn what's happened in the last 2 weeks.

Kevin Coleman
Oct 26 2018 16:01

Ok after a bit of messing around...I needed to initialize the data property as a non empty can define. IE if I did the following

data = new DefineMap({posts: null})

updates propagate. Is that intentional?

Gregg Roemhildt
Oct 26 2018 16:26
Nice job on the new can-stache docs. It really is quite detailed and easy to walk through. I love how thorough it is! It even covers topics like can-stache-loader for webpack which is nice