Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 20:45

    greenkeeper[bot] on @octokit

    (compare)

  • 20:43

    greenkeeper[bot] on @octokit

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

  • 19:54

    m-mujica on master

    Update dist for release (compare)

  • 19:54

    m-mujica on v6.2.1

    Update dist for release 6.2.1 (compare)

  • 19:43
    greenkeeper[bot] closed #5396
  • 19:43

    greenkeeper[bot] on can-observable-mixin-1.0.4

    (compare)

  • 19:43
    greenkeeper[bot] closed #5395
  • 19:43

    greenkeeper[bot] on can-observable-array-1.0.3

    (compare)

  • 19:43

    m-mujica on update

    (compare)

  • 19:43

    m-mujica on master

    Update packages to the latest v… Fix bundlesize Merge pull request #5398 from c… (compare)

  • 19:43
    m-mujica closed #5398
  • 18:57
    m-mujica synchronize #5398
  • 18:57

    m-mujica on update

    Fix bundlesize (compare)

  • 18:43
    cherifGsoul commented #5397
  • 18:39
    matthewp commented #5397
  • 18:26
    m-mujica opened #5398
  • 18:25

    m-mujica on update

    Update packages to the latest v… (compare)

  • 18:19
    cherifGsoul assigned #5397
  • 18:19
    cherifGsoul opened #5397
  • 18:13
    greenkeeper[bot] labeled #5396
kostya.aderiho
@kaderiho
Hey guys, I have the next situation: I need to fire an event in parent component (click on button) and child component needs to listen this event and do smth on this. So which is the best solution for implementing this? In old canjs (2.2.0) I used viewModel.dispatch method, but not aware that it works by the same way in 3.9.0. Thanks in advance!
Kevin Phillips
@phillipskevin
@frank-dspeed because they were breaking and I wanted to make a pre-release
I did that on the minor branch, just to be clear
@kaderiho the best way is to use data binding
click a button -> change a property on the viewModel -> pass that property to the child component
you can use https://canjs.com/doc/can-event.html, but it's a much harder pattern to write tests for
Frank Lemanschik
@frank-dspeed
@phillipskevin ah ok tought this was done to remove the tests also for release :)
Kevin Phillips
@phillipskevin
no, just don't want to take the time to figure out which dependency is breaking the production tests
we will fix that before anything is released
kostya.aderiho
@kaderiho
@phillipskevin thanks man, I will try it
Roger K
@thejavascriptist
@frank-dspeed thanks, re: the guides... A longer term ask would be to see guides which are more than samples running in jsbin. e.g. with best practices recommended by the can team etc. one example to look into is https://github.com/gothinkster/realworld This would also help people like me sell canjs to my managers and bring better awareness of canjs and donejs out.
Kevin Phillips
@phillipskevin
that's a good suggestion
longer examples are difficult since a lot of people won't spend that much time going through them
all of the donejs guides are bigger apps though
this one in particular: https://donejs.com/bitballs.html
a lot of the newer guides are focused more on new users, and not as much on selling to CTOs, etc
but we should try to accomplish both
obviously
Yeswanth Raghav T
@tyraghav

Hi All
I have a can.component element with tag person

<person {(mydetails)}="details"></person>
Where details is a can.model type
Where should I declare mydetails model in can.component in order to get the values of details to mydetails..??
In viewmodel or As seperate variable in can.component or Inside define...??
How should I declare it..??
My can.component is like this
Can.component.extend({
tag:'person',
template:can.stache("<h1>{{rollno}}<h1><h2>{{Data}}<h2>"),
viewModel:{
rollno:"111111",
Data:"111111="+mydetails.name
}});

The above one is not working
Can anyone please help me by letting me know how this could be done or can anyone please provide me the above can.component ?
I am new to can js.
Anyone please help

I am using can 2.3 version
Kevin Phillips
@phillipskevin
it should be part of the viewModel of the component
James Atherton
@James0x57
viewModel: {
  define: {
    Data: {
      get: function () {
        return "11111=" + this.attr("mydetails.name");
      }
    }
  },
  ...
}
Yeswanth Raghav T
@tyraghav
The above code is giving a error mydetails is not defined
James Atherton
@James0x57
you can add a "mydetails" property to your viewModel as well. But if you are passing it in to your person component:
<person {(mydetails)}="details"></person>
then it should be defined as whatever "details" is in the parent
Yeswanth Raghav T
@tyraghav
I can't get you
James Atherton
@James0x57
where are you including this code: <person {(mydetails)}="details"></person>?
Yeswanth Raghav T
@tyraghav
In some other statche
James Atherton
@James0x57
that other stache has a viewModel of its own, yeah?
Yeswanth Raghav T
@tyraghav
details is a model type which is like this
No
I am invoking the other statche from a can.control.extend type
James Atherton
@James0x57
viewModel: {
  define: {
    Data: {
      get: function () {
        return "11111=" + this.attr("mydetails.name");
      }
    },
    mydetails: {
      value: new DetailsModel()
    }
  },
  ...
}
Yeswanth Raghav T
@tyraghav
Thank you very much
It is working great
James Atherton
@James0x57
:beers: no problem :)
Yeswanth Raghav T
@tyraghav
If I want to use the value of Data inside a function in view model, how can I use it..??
Kevin Phillips
@phillipskevin
this.Data
Yeswanth Raghav T
@tyraghav
Thank you very much guys
James Atherton
@James0x57
it's canjs 2.3 so you should do this.attr("Data")
3.x you just do this.Data
Yeswanth Raghav T
@tyraghav
Yes
I tried that only
Thank
Frank Lemanschik
@frank-dspeed
@matthewp Special question for you is there some way to detect if something got loaded inside steal as a packege?
ah forget it i think all packages will look same i am evaluating a way to switch components and apps
@phillipskevin about the guides and CTO's if we get this app component switching working
we could base guides on that so every component guide (Small APP)
can be combined into the big app that Sells to a CTO like me
:D
my main case to jump into this was for example the components idea (Plugins) reuseable code