These are chat archives for canjs/canjs

Sep 2017
Szabolcs Schmidt
Sep 05 2017 06:31
@nriesco The situation is the following: there are two components foo and bar. bar is child component in foo. When something happens in foo - a model is modified - bar needs to update its model, too. I would like to send an event to bar to refresh its model. Thanks for the function binding idea. I'll check it!
Nico R.
Sep 05 2017 13:02
@sszabolcs usually you’ll set most of the binding behavior in the “inserted” event in the child component. There you’ll have access to its viewmodel via this.viewmodel
Then you can either set a property that is linked (via a binding) to the main compoentn foo
Sep 05 2017 13:18

Hi all, is anyone had a problem with method parseListData in Safari?

I'm calling it in my connection like as:

Priority.connection = connect(
    [realtime, authBehavior, parse, fallThroughCache, constructor, constructorStore, canMap], {
        url: '/pm/v1/priorities',
        Map: Priority,
        List: Priority.List,
        name: 'priority',
        parseListData(response) {
            return { data: response };

It works fine for all browsers, but for Safari doesn't work at all

Nico R.
Sep 05 2017 13:19
and within the foo component you can listen to a variable’s changes (I haven’t tried that yet) using something like this: (within the event object):
"{viewModel} myVariable": function() {
  console.log('do something when myVariable changes');
either that or you can trigger directly a function calling a child’s function that is binded to a parent’s function
@kaderiho does safari complain about some sort of security issue or it just won’t work? any feedback in the console?
Sep 05 2017 13:25
So, in parse.js file there is a parseListData method that is not calling in safari, seems that something can't run it exactly in this browser
I'm investigation this, but may be someone saw the same issue
Gregg Roemhildt
Sep 05 2017 14:41
I've seen that issue in ios
I also saw it in an older version of IE
I think it had to do with the order of the prototype chain when behaviors get connected. Super hard to diagnose though, I ended up putting the parse stuff as the first object in the array of behaviors.
seemed to fix it
Sep 05 2017 14:59
I've tried to put parse at the first object, but getting Cannot read property 'length' of undefined TypeError: Cannot read property 'length' of undefined now :(
Seems that needs to play with order, may be there is some winning combination for myself :)
I guess it should goes after constructor behavior
Gregg Roemhildt
Sep 05 2017 15:04
I'm not sure, getting the behaviors in the right order has been tricky for me
Brad Momberger
Sep 05 2017 15:30
@pYr0x I just released a new patch release of can-legacy-view-helpers that includes your PR
Runn Vermel
Sep 05 2017 21:17
Hi Guys, a simpler question today: being a newbie - does CanJs have a concept of light dom, and passing html that can be distributed into a component (using the content/slot tags, or equivalent)?
i.e. <customTag><div>light dom content</div></customTag>
Kevin Phillips
Sep 05 2017 21:22
yes, it does
Justin Meyer
Sep 05 2017 23:01
@/all Some upcoming event dates:
Runn Vermel
Sep 05 2017 23:01
thanks @phillipskevin !