Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 12:08
    chenquincy starred canjs/canjs
  • Apr 20 13:45
    lianghx-319 starred canjs/canjs
  • Apr 18 19:15
    kuwaitbinary starred canjs/canjs
  • Apr 13 20:21
    nbrunelle starred canjs/canjs
  • Apr 02 09:33
    xartd starred canjs/canjs
  • Mar 28 08:25
    vscuorzo starred canjs/canjs
  • Mar 24 13:17
  • Mar 16 13:19
    gdkttt starred canjs/canjs
  • Mar 08 16:50
    themyshkin removed as member
  • Mar 07 15:02
    baali-boudjemaa starred canjs/canjs
  • Feb 26 12:41
    horikeso starred canjs/canjs
  • Feb 22 17:42
    dnalbach starred canjs/canjs
  • Feb 17 13:45
    BirolAYDIN starred canjs/canjs
  • Feb 15 17:22
    prawee starred canjs/canjs
  • Feb 15 12:08
    philipstubbs13 starred canjs/canjs
  • Feb 13 20:42
    justinbmeyer commented #5456
  • Feb 13 06:49
    frank-dspeed commented #5456
  • Feb 12 21:42
    justinbmeyer closed #4872
  • Feb 12 21:42
    justinbmeyer closed #4870
  • Feb 12 21:42
    justinbmeyer closed #4868
Christopher Oliphant
@RALifeCoach
As usual, I need a little help getting started.
Here is my html
<!DOCTYPE html>
<html>
<head>
    <title>PGAT</title>
</head>
<body>
<script src="../../../node_modules/steal/steal.js" main="modules/page.players-redesign/player-bio/player-bio"></script>

<section class="clearfix">
    <div class="player-bio">
    </div>
</section>

</body>
</html>
and here is my module
import Component from 'can-component';
import Map from 'can-map';
import $ from 'jquery';
import stache from 'can-stache';
import template from './template-player-bio.stache!';

const PlayerBioViewModel = Map.extend({

});

export default Component.extend({
    tag: 'pgat-player-bio',
    template,
    viewModel: PlayerBioViewModel,
    events: {
        inserted: function () {
            console.log('here and here');
        }
    }
});

$(document.body).append(stache('<pgat-player-bio></pgat-player-bio>'));
I am getting an error trying to load the template. The error is, “404 localhost:8090/stache.js (Not Found)"
Christopher Oliphant
@RALifeCoach
@cherifGsoul any suggestions? Do I need a stealconfig file?
Mohamed Cherif Bouchelaghem
@cherifGsoul
you have can-stache installed?
Christopher Oliphant
@RALifeCoach
yes
If I change import template from './player-bio.stache!’; to import template from './player-bio.stache!can-stache’; I stop getting error, but it stops reading the JS file
Christopher Oliphant
@RALifeCoach
It does read the JS file, but doesn’t execute it
Mohamed Cherif Bouchelaghem
@cherifGsoul
Ok I will look into that this evening
try to use commonJS modules
Christopher Oliphant
@RALifeCoach
okay
I was trying to use steal and ES6
Can I use can 3.0 and not use steal?
Mohamed Cherif Bouchelaghem
@cherifGsoul
maybe for some packages but not all look at the dist folders
Christopher Oliphant
@RALifeCoach
why would I try to use commonJS modules?
Mohamed Cherif Bouchelaghem
@cherifGsoul
canjs 3.0 is written in commonjs
maybe it works well like this for now
Christopher Oliphant
@RALifeCoach
is there someone who can help me now? (I know you all have full time jobs as well as working on CanJS.)
It seems that working with CanJS is now my full time job.
Mohamed Cherif Bouchelaghem
@cherifGsoul
what kind of help? :)
Christopher Oliphant
@RALifeCoach
getting this very simple example to run
I don’t know commonJS and I would prefer not to have to learn it
Mohamed Cherif Bouchelaghem
@cherifGsoul
it's plain javascript
nothing more
just instead of import use require
like in the docs
Christopher Oliphant
@RALifeCoach
I switched my code from es6 using imports to be standard js with require. It is still not executing the code. The load works when I specify "system": { "ext": { "stache": "can-stache" } }, in package.json
But the code doesn’t run.
If I do not have the ext in package then it generates the state.js file not found
stache.js
Mohamed Cherif Bouchelaghem
@cherifGsoul
@RALifeCoach I did just this
var stache = require('can-stache');
console.log(stache);
I can see the stache object in the console
even with ES6 it work fine
Christopher Oliphant
@RALifeCoach
please show all of what you did.
Mohamed Cherif Bouchelaghem
@cherifGsoul
I will put it on a branch
Christopher Oliphant
@RALifeCoach
I need to see the invoking html and the module that you had you code in, the package json file, etc. Thanks
Mohamed Cherif Bouchelaghem
@cherifGsoul
ok we will go step by step is the first time with can 3 for me too :)
Mohamed Cherif Bouchelaghem
@cherifGsoul
sorry I didnt ignore node_modules
Christopher Oliphant
@RALifeCoach
np
I am working along side you
I commented out everything except one console.log
Now I am adding lines back in one at a time
Mohamed Cherif Bouchelaghem
@cherifGsoul
package.json has nothing complicated
Christopher Oliphant
@RALifeCoach
yes
now require a stache template
Mohamed Cherif Bouchelaghem
@cherifGsoul
ok
Christopher Oliphant
@RALifeCoach
I have everything back in except for the template
Mohamed Cherif Bouchelaghem
@cherifGsoul
what you mean?