Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 14 21:13
    greenkeeper[bot] labeled #5378
  • Oct 14 21:12
    greenkeeper[bot] opened #5378
  • Oct 14 21:12

    greenkeeper[bot] on can-simple-map-4.3.3

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

  • Oct 14 20:19
    greenkeeper[bot] labeled #5377
  • Oct 14 20:19
    greenkeeper[bot] opened #5377
  • Oct 14 20:19

    greenkeeper[bot] on @feathersjs

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

  • Oct 14 20:18
    greenkeeper[bot] labeled #5376
  • Oct 14 20:18
    greenkeeper[bot] opened #5376
  • Oct 14 20:18

    greenkeeper[bot] on @feathersjs

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

  • Oct 14 14:43
    greenkeeper[bot] closed #5373
  • Oct 14 14:43

    greenkeeper[bot] on can-deep-observable-1.0.1

    (compare)

  • Oct 14 14:42

    m-mujica on update-deep-observable

    (compare)

  • Oct 14 14:42

    m-mujica on master

    Update can-deep-observable to l… Merge pull request #5374 from c… (compare)

  • Oct 14 14:42
    m-mujica closed #5374
  • Oct 14 14:42
    m-mujica closed #5365
  • Oct 14 14:09
    f-ricci starred canjs/canjs
  • Oct 14 13:55
    greenkeeper[bot] commented #5375
  • Oct 14 13:55

    greenkeeper[bot] on core-js-3.3.2

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

  • Oct 14 10:51
    m-mujica review_requested #5374
  • Oct 14 07:43
    rjgotten commented #5358
Kevin Phillips
@phillipskevin
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
but because of the diffrence between apps and components this idea got attacked a bit
and only for you personal info i found out about donejs via EJS :)