Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 01:04
    greenkeeper[bot] commented #5392
  • 01:04

    greenkeeper[bot] on core-js-3.5.0

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

  • Dec 11 18:34
    greenkeeper[bot] labeled #5444
  • Dec 11 18:34
    greenkeeper[bot] opened #5444
  • Dec 11 18:34

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

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

  • Dec 11 18:30

    cherifGsoul on update-infrastructure-page

    (compare)

  • Dec 11 18:30

    cherifGsoul on master

    Update infrastructure page with… (compare)

  • Dec 11 18:30
    cherifGsoul closed #5441
  • Dec 11 18:30
    cherifGsoul closed #5417
  • Dec 10 17:40
    cherifGsoul review_requested #5443
  • Dec 10 16:47
    cherifGsoul review_requested #5441
  • Dec 10 16:35
    cherifGsoul synchronize #5441
  • Dec 10 16:35

    cherifGsoul on update-infrastructure-page

    Fix typos (compare)

  • Dec 10 10:01
    jkeruzec starred canjs/canjs
  • Dec 09 18:59
    cherifGsoul review_requested #5443
  • Dec 09 18:59
    cherifGsoul opened #5443
  • Dec 09 18:51

    cherifGsoul on document-inserted-removed-can6

    Add inserted/removed events to … (compare)

  • Dec 09 15:38
    greenkeeper[bot] labeled #5442
  • Dec 09 15:38
    greenkeeper[bot] opened #5442
  • Dec 09 15:38

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

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

Christopher Oliphant
@RALifeCoach
myId is assigned in the stache fragment for the component
Mohamed Cherif Bouchelaghem
@cherifGsoul
'#myId highlightplayer': function () {
                debugger;
            },
Christopher Oliphant
@RALifeCoach
okay - I used it without the #myId because the docs say:
events: {
    "click" : function(){
      var currentMessage = this.viewModel.attr("message");
      this.viewModel.attr("message", currentMessage+ "!")
    }
  }
Mohamed Cherif Bouchelaghem
@cherifGsoul
It listens to click event on the component tag
Christopher Oliphant
@RALifeCoach
The id in my case isn’t fixed. It is actually ‘xxx-‘ + pid
Mohamed Cherif Bouchelaghem
@cherifGsoul
use classes
class="js-my-el"
'.js-my-el highlightplayer': function () {
                debugger;
            }
Kevin Phillips
@phillipskevin
you can put the event in your template also
Christopher Oliphant
@RALifeCoach
but the component is repeated many times on the page - therefore the class would be repeated
Kevin Phillips
@phillipskevin
($highlightPlayer)=“highlightPlayer”
Christopher Oliphant
@RALifeCoach
I only want the change to apply to this row
that’s why the id is distinct
@phillipskevin isn’t that discouraged due to the performance impact?
Kevin Phillips
@phillipskevin
only if you’re going to have thousands of this component
Christopher Oliphant
@RALifeCoach
If I specify it as you indicated, then I can use the event as shown above?
Kevin Phillips
@phillipskevin
if you do it that way, highlightPlayer would be a function on your viewmodel
Christopher Oliphant
@RALifeCoach
and how do I fire it as an event from outside the component?
$.trigger
or can.trigger
Christopher Oliphant
@RALifeCoach
Kevin Phillips
@phillipskevin
no, it doesn't
the ($highlight)=“highlight” has to be on the same element you’re triggering the event on
Christopher Oliphant
@RALifeCoach
right - thanks
Kevin Phillips
@phillipskevin
no problem
Thomas Sieverding
@Bajix
@RALifeCoach How’s the project coming along?
Thomas Sieverding
@Bajix
How do I read/write to the root scope w/in a component
Thomas Sieverding
@Bajix
How does %root work?
dylanrtt
@dylanrtt
@Bajix %root is just a child map of all components' viewmodels, so you can do this.attr('%root.foo') or this.attr('%root.foo', bar)
Thomas Sieverding
@Bajix
dylanrtt
@dylanrtt
are you asking how to use it in a template?
Thomas Sieverding
@Bajix
yes
My impression was that I’d be able to do <foo *bar> … {{*bar.someProp}} ..</foo>
I’m a little confused though, as I had expected %root.bar to be set as the exported vm
dylanrtt
@dylanrtt
scope lookups to component viewmodels don't fall-through to %root if that's what you are thinking
whereas scope in the template does (not sure if I said that right)
Thomas Sieverding
@Bajix
I see - I had thought %root was the template scope
dylanrtt
@dylanrtt
This message was deleted
Thomas Sieverding
@Bajix
%root is the top most ref?
So if you’re doing leakScope: false, then child components would have %root === the vm of the parent
dylanrtt
@dylanrtt
yes, the top most ref
shouldn't matter with leakScope:whatever
Thomas Sieverding
@Bajix
That’s inconsistent w/ the docs. *bar should be the vm itself
dylanrtt
@dylanrtt
oh sorry my bad, I don't usually use that syntax
Thomas Sieverding
@Bajix
Well, leakScope would just mean that it’s now the top most ref
So if I had <my-app *app><my-service>{{>views/index}}</my-service></my-app>, shouldn’t I be able to do {{*app.foo}} within index?
dylanrtt
@dylanrtt
I don't think so. *app would only be available within the outer template. They are not passed down
Thomas Sieverding
@Bajix
Even if my-service uses leakScope: true?
dylanrtt
@dylanrtt
honestly, I'm not totally sure but I don't think reference scope is inherited in partials. not sure why the component's leakScope would matter