Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 09 18:59
    cherifGsoul review_requested #5443
  • Dec 09 18:59
    cherifGsoul opened #5443
  • Dec 09 18:51

    cherifGsoul on document-inserted-removed-can6

    Add inserted/removed events to … (compare)

  • Dec 09 15:38
    greenkeeper[bot] labeled #5442
  • Dec 09 15:38
    greenkeeper[bot] opened #5442
  • Dec 09 15:38

    greenkeeper[bot] on can-view-live-5.0.1

    fix(package): update can-view-l… (compare)

  • Dec 08 21:21
    greenkeeper[bot] commented #5392
  • Dec 08 21:21

    greenkeeper[bot] on core-js-3.4.8

    chore(package): update core-js … (compare)

  • Dec 06 18:40
    cherifGsoul review_requested #5441
  • Dec 06 18:39
    cherifGsoul opened #5441
  • Dec 06 18:22

    cherifGsoul on update-infrastructure-page

    Update infrastructure page with… (compare)

  • Dec 06 18:14
    greenkeeper[bot] commented #5422
  • Dec 06 18:14

    greenkeeper[bot] on @feathersjs

    chore(package): update @feather… (compare)

  • Dec 06 18:11
    greenkeeper[bot] commented #5401
  • Dec 06 18:11

    greenkeeper[bot] on @feathersjs

    chore(package): update @feather… (compare)

  • Dec 04 22:03
    chasenlehara opened #5440
  • Dec 04 22:03
    chasenlehara labeled #5440
  • Dec 04 19:18
    cherifGsoul review_requested #5432
  • Dec 04 14:09
    m-ahmadi starred canjs/canjs
  • Dec 04 10:52
    ansyeow starred canjs/canjs
Kevin Phillips
@phillipskevin
there is a link at the top of gitter that you can use to get started
deepasrikanth
@deepasrikanth
So this code works if I use fixtures.. but this problem happens when I really hit the APIs that talk to my local mongo
If I copy the code in jsBin you won't be able to see the problem by running it but you can see the code I guess
Morgan Heimbeck
@Xitstrategies
try doing this in your ViewModel instead of in the init
"eventGroups": {
    get: function() {
      return EventGroup.getList({});
    }
  },
deepasrikanth
@deepasrikanth
will try that. I just tried this in my model definition "cacheConnection": "real-time",
seems to be working. is that a valid configuration?
deepasrikanth
@deepasrikanth
never mind my last question
deepasrikanth
@deepasrikanth
Thank you guys. changing super map to base map worked.
Gira Minus
@gKreator
@phillipskevin Thanks I figured it out that night I forgot to mention it.
Is there any good way to prompt somebody to save a form as they are trying to navigate away? Let's say they filled out a form and forgot to save. Is there a decent way to prevent route change or force them back or something?
I know if they close the web browser you can do the js onbeforeunload event
Frank Lemanschik
@frank-dspeed
@gKreator you can let the on route change event block if form is filled partial
i don't remember exactly where it is as i don't use routing from canJs any more
i found out via benchmarks that my server side handels packaging and caching and all that more efficent so i only use viewModel + component
https://v2.canjs.com/docs/can.route.html#section_Changingtheroute_ here if your using v2 read using route with can.control
here search for listen to event changes
if your using v3
:d
i made animated gifs from donejs meetings ;)
this are my both favorit chason lauthing and justin saying every thing is possible :)
Matthew Phillips
@matthewp
:smile:
Justin Meyer
@justinbmeyer
haha
Chasen Le Hara
@chasenlehara
lol
Frank Lemanschik
@frank-dspeed
I tought its a EPIC :)
its useable for github and that
it could also be used realy informativ to show parts from demos or live talks on youtube but i used it for that
Kyle Gifford
@kylegifford
Is the shorthand for can-component events still around? As in,
'{viewModel} thingThatChanged': 'methodToCall'
and is methodToCall on the viewModel, or a method on the events object?
Kevin Phillips
@phillipskevin
yes, that still works
I think it has to be a method on the events object
it definitely works that way: http://jsbin.com/xahuzeyabi/edit?js,output
yeah, has to be on the events object
Kevin Phillips
@phillipskevin
component doesn’t do anything special to let you use the viewModel
Kyle Gifford
@kylegifford
thanks
Nils Lundquist
@nlundquist

hey all, I've got an issue with 2.3 that I'm wondering if anyone is familiar with:

trying to pass a function from a parent component to a child with a binding like {on-my-event}="@eventHandler" but since the child component is using a can.Map with a define, eventHandler is set as the define value property for onMyEvent and any define value function prop is called as if it's a value defaulter function. see the code around: https://github.com/canjs/canjs/blob/2.3-legacy/map/define/define.js#L45

only solution i can come up with is to pass the child component a function that returns the function i actually want to use as the value of the prop, but that seems like a pretty sad hack for something so simple.
Nils Lundquist
@nlundquist
def not intuitive to require a parent component to pass a child component wrapped functions to prevent this from happening
Justin Meyer
@justinbmeyer
@nlundquist if you want a default property value that is a function, the only way is to create a function that returns a function
but I'm not sure I understand you right
what you linked to only deals with maps ... seems like there's something around view bindings
Nils Lundquist
@nlundquist

hey Justin. I don't need a default value. I'm fine with the default property requiring a function to return a function since that's all in the view model config of the child. What I'm trying to do is pass a function from a parent component to a child component, and use that function within the child component logic.

Right now, whenever I pass a component from the parent component to the child component, the child component calls that function during it's a initialization because it thinks that function is a 'defaulter()' value like mentioned in the docs here: https://v2.canjs.com/docs/can.Map.prototype.define.value.html

I don't think there is an issue with the view bindings since the function is successfully passed from the parent component to child. The function is set on the child VM, in my example case, as the value on the onMyEvent property of the VM.

I just don't want that passed value to be called during child component VM initialization. The map/define/define.js code I linked to is where this function is added to the set of Map.defaultGenerators
I want to avoid that happening since i'm not passing a function for use as a default value generator, I'm passing it for use inside the child component logic
Nils Lundquist
@nlundquist
@justinbmeyer if what i'm trying to accomplish is still unclear lets jump on a screenshare
Justin Meyer
@justinbmeyer
@nlundquist can you create a JSBin?
do you need to use the * type?
Nils Lundquist
@nlundquist
i figured out my issue - it was in my code, the function i was trying to pass from the parent was itself a value property of a define map, so that needed to be a function that returned a function. figured it out as i was making a JSBin :sweat: