Where communities thrive


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

    greenkeeper[bot] on core-js-3.3.1

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

  • 14:49
    greenkeeper[bot] labeled #5375
  • 14:49
    greenkeeper[bot] opened #5375
  • 14:49

    greenkeeper[bot] on core-js-3.3.0

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

  • Oct 12 18:35
    matthewp commented #5358
  • Oct 12 18:15
    chasenlehara commented #5358
  • Oct 12 06:41

    greenkeeper[bot] on @octokit

    (compare)

  • Oct 12 06:39

    greenkeeper[bot] on @octokit

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

  • Oct 11 19:01
    m-mujica edited #5374
  • Oct 11 19:01
    m-mujica opened #5374
  • Oct 11 19:00

    m-mujica on update-deep-observable

    Update can-deep-observable to l… (compare)

  • Oct 11 18:55
    m-mujica edited #5365
  • Oct 11 18:54
    greenkeeper[bot] labeled #5373
  • Oct 11 18:54
    greenkeeper[bot] opened #5373
  • Oct 11 18:54

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

    fix(package): update can-deep-o… (compare)

  • Oct 11 16:42
    LakshanKarunathilake starred canjs/canjs
  • Oct 11 14:58
    greenkeeper[bot] labeled #5372
  • Oct 11 14:58
    greenkeeper[bot] opened #5372
  • Oct 11 14:58

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

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

Julian
@pYr0x
and how do you change hasMedia?
please notice, that the viewModel is an external var
Christopher Oliphant
@RALifeCoach
It is contained within another component and set by the parent when the data changes.
In debug, when I examine the component, I can see the value in the attribute has changed, but I don’t see the change within the component.
    var Model = can.Map.extend({
        define: {
            hasMedia: {
                type: 'boolean',
                set: function () {
                    debugger;
                }
            }
        }
    });
    can.Component.extend({
        tag: 'feature-icon',
        template: can.view('/modules/components/feature-icon/feature-icon.stache'),
        viewModel: Model
    });
Christopher Oliphant
@RALifeCoach
Still no luck
BTW, I included can/stache/system, but <can-import> didn’t work
Julian
@pYr0x
how do you mean , inclueded can/stache/system?
how do you use canjs?
AMD?
global?
Christopher Oliphant
@RALifeCoach
global
Julian
@pYr0x
and how could you include can/stache/system ?
Christopher Oliphant
@RALifeCoach
so when I built the custom file, I included can/stache/system
Mohamed Cherif Bouchelaghem
@cherifGsoul
I think a dependency manager (steal,requirejs,webpack) is required to use can/stache/system
Julian
@pYr0x
ok
Christopher Oliphant
@RALifeCoach
@cherifGsoul any suggestions on my delema
Mohamed Cherif Bouchelaghem
@cherifGsoul
@RALifeCoach I didnt follow from the bginning
:/
Christopher Oliphant
@RALifeCoach

okay - I have a component:

<feature-icon type="article" types="articles" 
                                  isActive="{{isActive}}" 
                                  hasMedia="{{hasMediaContent('articles')}}" 
                                  profilesURL="options.profilesURL"></feature-icon>

with the component defined as:

    var Model = can.Map.extend({
        define: {
            hasMedia: {
                type: 'boolean',
                set: function () {
                    debugger;
                }
            }
        }
    });
    can.Component.extend({
        tag: 'feature-icon',
        template: can.view('/modules/components/feature-icon/feature-icon.stache'),
        viewModel: Model
    });

The debugger is never called

I know the value in hasMedia is initially set to false and is later set to true
Mohamed Cherif Bouchelaghem
@cherifGsoul
use has-mediaas attribute in the component
Christopher Oliphant
@RALifeCoach
The attribute value never seems to get changed in the viewModel
Mohamed Cherif Bouchelaghem
@cherifGsoul
change it to what I sugget
<feature-icon type="article" types="articles" 
                                  is-active="{{isActive}}" 
                                  has-media="{{hasMediaContent('articles')}}" 
                                  profiles-URL="options.profilesURL"></feature-icon>
Christopher Oliphant
@RALifeCoach
Thanks - that was all it took
Mohamed Cherif Bouchelaghem
@cherifGsoul
works?
Christopher Oliphant
@RALifeCoach
It is better, not sure if all is working yet
Julian
@pYr0x
@cherifGsoul great job :)
Veni vidi vici
:clap:
Mohamed Cherif Bouchelaghem
@cherifGsoul
thank you I dont know if those points exist in the docs
Christopher Oliphant
@RALifeCoach
Yes - it is working now. the attribute is has-media, but when I use it in the stache file it is hasMedia. A bit confusing.
Mohamed Cherif Bouchelaghem
@cherifGsoul
@RALifeCoach it'scanjs recommandation properties camel cased like hasMediaand template attributes hypenated like has-media
dont be confused bro :)
Christopher Oliphant
@RALifeCoach
I am easily confused. (And I am having a lot of fun.)
I just hope I am not being too much of a bother. I really appreciate all the assistance I am getting from folks here.
Matthew Phillips
@matthewp
Every time I come here and see 50+ recent messages i'm terrified but mostly excited :)
CanJS is blowing up!
Mohamed Cherif Bouchelaghem
@cherifGsoul
@matthewp we are the night watch :D
but it's the efternoon here
Matthew Phillips
@matthewp
hehe
Christopher Oliphant
@RALifeCoach
Me again. I am trying to access the view model from an event.
the view model has a function, the events tries:
this.viewModel.vmFunction();
The message is vmFunction is not a function
If I break at that statement and add a watch, this.viewModel.vmFunction returns undefined
Mohamed Cherif Bouchelaghem
@cherifGsoul
@RALifeCoach maybe full code (component, template) can help to have a quick answer
Christopher Oliphant
@RALifeCoach
Component:
    can.Component.extend({
        tag: 'player-row',
        template: can.view('/modules/components/player-row/player-row.stache'),
        helpers: helpers,
        events: {
            '.add-to-favorite click': function () {
                this.viewModel.callParent('onPinPlayer');
            }
        }
Map:
    var Map = MapBase.extend({
        define: {
            options: {
                Type: OptionsMap
            },
            pid: {
                type: 'string'
            },
            player: {
                Type: PlayerMap
            },
        },

        callParent: function (method) {
            this.attr(method)();
        },