These are chat archives for canjs/canjs

4th
Oct 2018
Justin Meyer
@justinbmeyer
Oct 04 2018 02:32
Julian
@pYr0x
Oct 04 2018 07:16
@justinbmeyer but thats to point, i want to have my html boilerplate in the html page and i dont want to have only a <my-app></my-app> snippet. is there no easy code change that will enable content within a mounted component?
Ivo Pinheiro
@ivospinheiro
Oct 04 2018 08:36
Hi guys,
I'm working now on upgrading my application from CanJS 3 to CanJS 4 and I'm facing some problems related with the usage of can-set and can-jquery.
Do I have to replace the can-set package by can-set-legacy and can-jquery by can-ajax for ajax requests and jquery?
Gregg Roemhildt
@roemhildtg
Oct 04 2018 14:51
Anyone know why this isn't working? (can-stache@4.13)
scope.vm appears to be pointing to component 1 viewmodel
<component-1>
    <component-2>
        <component-3 val:from="scope.vm.prop" />
    </component-2>
</component-1>
Viktor Busko
@Lighttree
Oct 04 2018 14:58

@roemhildtg

https://canjs.com/doc/can-stache/keys/scope.html#scope_viewModel

maybe you need scope.viewModel.prop ?

not vm
Viktor Busko
@Lighttree
Oct 04 2018 15:03
Because vm documentation says: scope.vm - The first context that is a viewModel. Which is component-1

maybe you need scope.viewModel.prop ?

Or even this.prop

Gregg Roemhildt
@roemhildtg
Oct 04 2018 15:10
Oh okay. Thanks @Lighttree
I'll give that a shot
So I wanted to reference the prop on the root view model. I think the only way to do this would be to walk up the scope then with ../
Viktor Busko
@Lighttree
Oct 04 2018 15:13
aahh.. I was thinking that you wanted to get component-3 prop )
Gregg Roemhildt
@roemhildtg
Oct 04 2018 15:13
Yeah, I can see I mislead you :) sorry I wasn't clear on that.
But your link to the docs helped figure out why I had the issue
:)
Ivo Pinheiro
@ivospinheiro
Oct 04 2018 16:22
Hi again!
I'm facing a problem related with the usage of DefineMap together with can-connect constructor store.
Here is a link to a sample project that shows the problem:
https://codesandbox.io/embed/j17m0n23w?expanddevtools=1&moduleview=1
Ivo Pinheiro
@ivospinheiro
Oct 04 2018 16:51
It seems that when using can-connect constructor store and adding an eventlistener on a derived property that calls serialize function, all the new instances will have the same property values
Ivo Pinheiro
@ivospinheiro
Oct 04 2018 17:45
I was trying to upgrade can-define versions 2.X one by one to check when this code stops working and it seems that this issue has been introduced from version v2.5.12 to v2.6.0