Where communities thrive


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

    greenkeeper[bot] on semver-7.0.0

    chore(package): update semver t… (compare)

  • Dec 14 16:58
    millette starred canjs/canjs
  • Dec 14 00:14
    greenkeeper[bot] labeled #5449
  • Dec 14 00:14
    greenkeeper[bot] opened #5449
  • Dec 14 00:14

    greenkeeper[bot] on can-super-model-2.0.0

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

  • Dec 14 00:13
    greenkeeper[bot] labeled #5448
  • Dec 14 00:13
    greenkeeper[bot] opened #5448
  • Dec 14 00:13

    greenkeeper[bot] on can-define-rest-model-2.0.0

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

  • Dec 14 00:12
    greenkeeper[bot] labeled #5447
  • Dec 14 00:12
    greenkeeper[bot] opened #5447
  • Dec 14 00:12

    greenkeeper[bot] on can-define-realtime-rest-model-2.0.0

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

  • Dec 14 00:07
    greenkeeper[bot] labeled #5446
  • Dec 14 00:07
    greenkeeper[bot] opened #5446
  • Dec 14 00:07

    greenkeeper[bot] on can-connect-ndjson-2.0.0

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

  • Dec 13 21:27

    greenkeeper[bot] on @octokit

    (compare)

  • Dec 13 21:25

    greenkeeper[bot] on @octokit

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

  • Dec 13 21:21

    greenkeeper[bot] on @octokit

    (compare)

  • Dec 13 21:20

    greenkeeper[bot] on @octokit

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

Julian
@pYr0x
or provide a solution
Mohamed Cherif Bouchelaghem
@cherifGsoul
@jeroencornelissen thank you for submiting it in donejs forums
This message was deleted
Christopher Oliphant
@RALifeCoach
in the docs it recommends including css files with components
how best to do that?
is there some way of bringing the file into the component?
Guido Smeets
@gsmeets
Depending on how much css you have I wouldn't bother
Julian
@pYr0x
dont understand the question...
Christopher Oliphant
@RALifeCoach
there is a property on component for template, it would be nice to have a property for css - that could be a css, less or sass string or file
Julian
@pYr0x
what do you mean with property?
Christopher Oliphant
@RALifeCoach
can.Component.extend({
tag: ‘tag-name’
*template*: can.view(’path to stache file’)
wwould tag and template not be properties of the component?
Julian
@pYr0x
include css or less import 'path/to/style.css';
Christopher Oliphant
@RALifeCoach
except this project does not use steal
Julian
@pYr0x
or require();
tried <can-import>?
in the template
Christopher Oliphant
@RALifeCoach
interesting suggestion, can I use it to import a script as well?
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