Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 22:20
    greenkeeper[bot] labeled #5391
  • 22:20
    greenkeeper[bot] opened #5391
  • 22:20

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

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

  • 19:08
    cherifGsoul labeled #5390
  • 19:07
    cherifGsoul opened #5390
  • 18:45
    greenkeeper[bot] labeled #5389
  • 18:45
    greenkeeper[bot] opened #5389
  • 18:45

    greenkeeper[bot] on can-observable-bindings-1.3.0

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

  • 18:29

    matthewp on master

    Update dist for release (compare)

  • 18:29

    matthewp on v6.1.3

    Update dist for release 6.1.3 (compare)

  • 17:59

    matthewp on can-observable-array-1.0.2

    (compare)

  • 17:59

    matthewp on master

    fix(package): update can-observ… Merge pull request #5388 from c… (compare)

  • 17:59
    matthewp closed #5388
  • 16:46
    greenkeeper[bot] labeled #5388
  • 16:46
    greenkeeper[bot] opened #5388
  • 16:46

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

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

  • 12:45
    greenkeeper[bot] labeled #5387
  • 12:45
    greenkeeper[bot] opened #5387
  • 12:45

    greenkeeper[bot] on can-stache-element-1.0.2

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

  • 09:49
    chasenlehara edited #5384
Kevin Phillips
@phillipskevin
I definitely misunderstood that to mean the data wouldn’t be changing
I have to run to a meeting, be back in a few
Christopher Oliphant
@RALifeCoach
okay - thanks
Kevin Phillips
@phillipskevin
I would say that you do want to use a Map then
but maybe Justin can explain more what he was suggesting when he is around later
Christopher Oliphant
@RALifeCoach
actually - your question started me thinking - I changed .attr(‘player', player) to .data(‘player’, player) and the JSBin is now working
Kevin Phillips
@phillipskevin
it’s working? or it’s just not throwing an error?
I don’t see it change to iiiii ppppp
Christopher Oliphant
@RALifeCoach
You’re right - I spoke too soon
Bummer
Christopher Oliphant
@RALifeCoach
that’s working
it’s a bit sketchy, but it’s working
Kevin Phillips
@phillipskevin
ok
I’m not really sure if that will perform any better
Christopher Oliphant
@RALifeCoach
either am I
and it will take me a couple of hours of work to find out
Thomas Sieverding
@Bajix
Why are you doing this playerStr stuff?
You can just set player to an object
Christopher Oliphant
@RALifeCoach
Because I am trying to pass an object into the component via attributes
that didn’t work when I tried it
Thomas Sieverding
@Bajix
You’re trying to construct the component from JSON passed as attributes?
Christopher Oliphant
@RALifeCoach
yes
Thomas Sieverding
@Bajix
I think something akin to data-player=‘{“foo”:”bar”}’ would work
This would only work on insertion
Also, but why?
Christopher Oliphant
@RALifeCoach
I have the insertion working fine. I need help getting the update to work.
Why? An idea suggested by Justin.
Kevin Phillips
@phillipskevin
@justinbmeyer in many ways my code is quite simple. All data is display only. There is some binding against controls, but not against the data itself.
This message was deleted
This message was deleted
Thomas Sieverding
@Bajix
Yea, I think you’ve misconstrued what he was saying
Kevin Phillips
@phillipskevin
@RALifeCoach if that's the case, I wouldn't convert it to a Map at all
since Justin won’t be around until later this evening, I took a guess that he meant to just pass the raw data to the template renderer
then we went down this rabbit hole
Christopher Oliphant
@RALifeCoach
@Bajix any ideas on how to pass an object into the component?
Thomas Sieverding
@Bajix
can.view(‘#my-template’, { player: {} }, function( frag ) { … })
Christopher Oliphant
@RALifeCoach
that gets it in - what about updating?
Thomas Sieverding
@Bajix
You have several options. 1) Update it within the component. 2) Update your root scope lexically 3) Use sibling components, write to the reference scope & have your main component bind to changes 4) Use can.viewModel 5) Use Model stores to indirectly update data
can.view will accept a PJSO, can.Map instance, or can.view.Scope instance
Christopher Oliphant
@RALifeCoach
  1. I understand
  2. I do not understand
  3. I understand
  4. How would I access can.viewModel from outside the component?
  5. I do not know what you mean by Model stores?
Thomas Sieverding
@Bajix
You could use a can.view.Scope instance to build a scope tree from multiple can.Map instances, that would traverse in reverse order
Christopher Oliphant
@RALifeCoach
Remember, the goal is to avoid using can.Map.
Thomas Sieverding
@Bajix
That’s a silly goal
If you pass a PJSO into can.view, it’ll become a can.Map instance regardless
Christopher Oliphant
@RALifeCoach
lol - it was suggested by Justin - I am just trying to figure out what he meant
Thomas Sieverding
@Bajix
He meant you should use type: ‘*’
Christopher Oliphant
@RALifeCoach
Here is his statement, "if that's the case, I wouldn't convert it to a Map at all”