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)

Julian
@pYr0x
i think so
try it
Christopher Oliphant
@RALifeCoach
I will, do you know the docs mean when they say that can-import only works with can.autorender?
Julian
@pYr0x
it says with can.autorender or the system plugin
Christopher Oliphant
@RALifeCoach
even still, I am not sure what that means
you have to use stache can/view/stache/system
it means, it works with stache templates and a script tag that is tagged as autorender
Christopher Oliphant
@RALifeCoach
This project is not using steal or system. There is no DI.
Julian
@pYr0x
you dont need steal
or system
it works with stache
which is provided by stache
Christopher Oliphant
@RALifeCoach
okay - I will play with it and see what I can figure out
Christopher Oliphant
@RALifeCoach
I apologize for asking so many questions. And I now have another one.

I have a component like so:

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

The ‘hasMedia’ attribute changes, but the binding to ‘hasMedia’ doesn’t fire.

    can.Component.extend({
        tag: 'feature-icon',
        template: can.view('/modules/feature-icon/feature-icon.stache'),
        viewModel: can.Map.extend({
            init: function () {
                this.bind('hasMedia', function () {
                    debugger;
                });
            },
            hasMedia: false
        })
    });
Christopher Oliphant
@RALifeCoach
when I examine the element I can see that hasMedia has changed
Julian
@pYr0x
try
better use the define plugin... getter and setter
for making sideeffects
Christopher Oliphant
@RALifeCoach
The first suggestion didn’t work.
    can.Component.extend({
        tag: 'feature-icon',
        template: can.view('/modules/components/feature-icon/feature-icon.stache'),
        viewModel: can.Map.extend({
            hasMedia: false
        }),
        events: {
            '{viewModel} hasMedia': function () {
                debugger;
            }
        }
    });
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>