Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 16 00:11
    greenkeeper[bot] labeled #5458
  • Jan 16 00:11
    greenkeeper[bot] opened #5458
  • Jan 16 00:11

    greenkeeper[bot] on can-simple-dom-1.7.1

    fix(package): update can-simple… (compare)

  • Jan 14 01:51
    likun7981 starred canjs/canjs
  • Jan 13 14:06
    piraz starred canjs/canjs
  • Jan 11 00:56
    KonTrax starred canjs/canjs
  • Jan 10 02:37
    jlburke starred canjs/canjs
  • Jan 09 04:17
  • Jan 09 04:17
    bbbbbroot starred canjs/canjs
  • Jan 06 18:58
    greenkeeper[bot] commented #5442
  • Jan 06 18:58

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

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

  • Jan 06 18:29
    greenkeeper[bot] opened #5457
  • Jan 06 18:29

    greenkeeper[bot] on can-dom-mutate-2.0.8

    fix(package): update can-dom-mu… (compare)

  • Jan 06 05:48
    frank-dspeed edited #5456
  • Jan 06 05:41
    frank-dspeed edited #5456
  • Jan 06 05:34
    frank-dspeed edited #5456
  • Jan 06 05:31
    frank-dspeed opened #5456
  • Jan 05 06:20
    brandon93s starred canjs/canjs
  • Dec 28 2019 04:23

    chasenlehara on chasenlehara-patch-1

    (compare)

  • Dec 28 2019 04:23

    chasenlehara on master

    Move the inserted/removed text … (compare)

Frank Lemanschik
@frank-dspeed
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:
Gira Minus
@gKreator
blob
where does sound come from?
Justin Meyer
@justinbmeyer
@gKreator doesn't seem like anywhere. We probably need a better example
Gira Minus
@gKreator
I'm having the worst problem with canjs... it does not report most errors and just crashes silently
Chasen Le Hara
@chasenlehara
@gKreator Can you reproduce the issue in a JS Bin?
Gira Minus
@gKreator
No, it works on jsbin. I think I'm using a wrong combination of packages or something. I have the same issue on 2 projects.
Mike 'mitch' Mitchel
@mikemitchel
Hello all. If I have a stache in CanJS 2.3 with an href, href="{{feedbackFormUrl}}, can I make it open in a new tab/window with a built in can-stache solution or would I need to make a custom helper to handle it?
Mike 'mitch' Mitchel
@mikemitchel
answered my own question - much simpler than I thought target=“_blank”
Gira Minus
@gKreator
Yup
Mike 'mitch' Mitchel
@mikemitchel
in the a tag
helps to refresh the cache :-) as well
Guido Smeets
@gsmeets
does anyone know if creating references in a tree structure from child to parent (i.e. creating circular references) can cause memleaks? Or is canjs ( or the browser gc) smart enough to clean that up?
Gira Minus
@gKreator
Im pretty sure every variable in js is a reference
Frank Lemanschik
@frank-dspeed
@gsmeets good question i like it the answer is more complex then you think :) it depends on your code if gc cleans up or not most efficent way is to never let gc happen!
so if you want to clean up a var let do it from hand.