Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 16:23
    phillipskevin closed #4841
  • Oct 15 21:43

    phillipskevin on master

    Update dist for release (compare)

  • Oct 15 21:43

    phillipskevin on v6.1.1

    Update dist for release 6.1.1 (compare)

  • Oct 15 21:34

    phillipskevin on can-observable-mixin-1.0.2

    (compare)

  • Oct 15 21:34

    phillipskevin on master

    fix(package): update can-observ… Merge branch 'master' into gree… Merge pull request #5382 from c… (compare)

  • Oct 15 21:34
    phillipskevin closed #5382
  • Oct 15 21:34

    phillipskevin on can-make-map-1.2.2

    (compare)

  • Oct 15 21:34

    phillipskevin on master

    fix(package): update can-make-m… Merge pull request #5380 from c… (compare)

  • Oct 15 21:34
    phillipskevin closed #5380
  • Oct 15 20:30
    phillipskevin synchronize #5382
  • Oct 15 20:30

    phillipskevin on can-observable-mixin-1.0.2

    fix(package): update can-observ… fix(package): update can-simple… Merge pull request #5372 from c… and 2 more (compare)

  • Oct 15 20:30
    phillipskevin opened #5382
  • Oct 15 20:28

    phillipskevin on can-simple-map-4.3.3

    (compare)

  • Oct 15 20:28

    phillipskevin on master

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

  • Oct 15 20:28
    phillipskevin closed #5378
  • Oct 15 20:26

    phillipskevin on can-observable-mixin-1.0.1

    (compare)

  • Oct 15 20:26

    phillipskevin on master

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

  • Oct 15 20:26
    phillipskevin closed #5372
  • Oct 15 20:25

    phillipskevin on update-make-map

    (compare)

  • Oct 15 20:25
    phillipskevin closed #5381
Kevin Phillips
@phillipskevin
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”
and using ‘*’ requires a map
Kevin Phillips
@phillipskevin
like I said before, I think he might have said that thinking that you don’t need to update the data
“the case” in the statement “if that’s the case” was that your data didn’t need binding
Thomas Sieverding
@Bajix
You would need to use a can.Map.extend that takes advantage of type: ‘*’ to prevent those properties from automatically being converted
If you just pass a PJSO into can.view, it’s the same as constructing a can.Map
The only way to avoid implicitely construction can.Map / can.List instances is to explicitely use type: ‘*’ on those properties
Christopher Oliphant
@RALifeCoach
You could be right. I will await his return and see what he has to say on the matter. I managed to solve the problem, and that was fun.
It is now time for me to run. Thanks again for all your help and assistance.