Where communities thrive


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

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

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

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

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

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

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

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

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

  • 00:07
    greenkeeper[bot] labeled #5446
  • 00:07
    greenkeeper[bot] opened #5446
  • 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)

  • Dec 12 19:26
    cherifGsoul review_requested #5443
  • Dec 12 18:34
    cherifGsoul synchronize #5443
  • Dec 12 18:34

    cherifGsoul on document-inserted-removed-can6

    Update after review (compare)

  • Dec 12 17:44

    cherifGsoul on theme-3.0.0-pre.5

    (compare)

Mohamed Cherif Bouchelaghem
@cherifGsoul
can-fixture yes is for testing and developing purpose to work on the frontend part withourt the API/server
Christopher Oliphant
@RALifeCoach
I was able to replace can-fixture with getData in can-connect
Mohamed Cherif Bouchelaghem
@cherifGsoul
ok
can-fixture is just to simulate ajax/api calls
Christopher Oliphant
@RALifeCoach
But I can’t get the viewModel updated from a component event unless I define my viewModel as a Map and then use this.viewModel.attr(‘prop’, ‘some value)
When I convert from a Map to a DefineMap, I can’t update it at all
Leath Cooper
@IcculusC
This message was deleted
Mohamed Cherif Bouchelaghem
@cherifGsoul
@RALifeCoach do use to 2.x Map with define plugin?
Leath Cooper
@IcculusC
I'm using DefineMap myself, and it works great, but I am using the this.viewModel.foo = "bar"; setters
Sunil George
@georgesunil81
A quick question - if I add some HTML dynamically to the DOM, I wanted to have the inline stache keys to resolve to values, is that possible? For example, if I do something like -
```
Mohamed Cherif Bouchelaghem
@cherifGsoul
@IcculusC if you are sure you can you open an issue?
Leath Cooper
@IcculusC
I'm not 100% sure
Christopher Oliphant
@RALifeCoach
I am using can-map installed via npm - that should be 3.0
Leath Cooper
@IcculusC
I mean it seems ridiculous... it's failing 5 tests and it's completely broken
am I really the only person seeing that?
Mohamed Cherif Bouchelaghem
@cherifGsoul
you can use can-define also
@IcculusC Im installing dependecies
Leath Cooper
@IcculusC
thank you
Christopher Oliphant
@RALifeCoach
@IcculusC do you have a sample of using DefineMap as a viewModel and updating it from a compnent’s event?
Sunil George
@georgesunil81
 $('#my-div').append('<p>{{mykey}}</p>');
Leath Cooper
@IcculusC
I'm actually not using events at the moment
I'm fighting with event bindings instead
Christopher Oliphant
@RALifeCoach
@cherifGsoul can you show me an example?
Sunil George
@georgesunil81
Is there a way that the above stache key be resolved into its value also when it is dynamically inserted into the DOM?
Mohamed Cherif Bouchelaghem
@cherifGsoul
@RALifeCoach I dont have working example but you can check the tests
@georgesunil81 $('#my-div').append(can.view('<p>{{mykey}}</p>',{myKey: value}));
Sunil George
@georgesunil81
Thanks @cherifGsoul I will try it out. Thanks for the help.
Mohamed Cherif Bouchelaghem
@cherifGsoul
np
@IcculusC did you check the binding docs?
Christopher Oliphant
@RALifeCoach
‘check the tests’ that sounds like a very time consuming activity
Leath Cooper
@IcculusC
@cherifGsoul yeah, I opened an issue on can-component when I thought it was an error there if you want to see how I'm using it it's issue #27
err, on that repo not his one
canjs/can-component#27
@RALifeCoach just gotta install dependencies and type npm test lol
Christopher Oliphant
@RALifeCoach
I am looking for a very specific piece of code to discover the magic syntax to make this work. That won’t happen by typing npm test.
Mohamed Cherif Bouchelaghem
@cherifGsoul
@RALifeCoach I hope you are just experiementing with 3.0!!
Christopher Oliphant
@RALifeCoach
Experimenting or not I still need to find the magic syntax.
(As a comment that how working with CanJS feels. You fight with it until you find the magic syntax and then it starts working.)
Mohamed Cherif Bouchelaghem
@cherifGsoul
@RALifeCoach How you write your component?
Christopher Oliphant
@RALifeCoach
Component.extend({
    tag: 'pgat-player-bio',
    template,
    viewModel: PlayerBioViewModel,
    events: {
        inserted: function () {
            Players.get({ id: 'id' }).then($.proxy((data)=>{
                this.onPlayersData(data);
            }, this));
            console.log(this.viewModel.personalStats.scoringAverage;
        },
        onPlayersData: function (playerList) {
            this.players = {};
            playerList.players.forEach((player)=>{
                this.players[player.playerId] = player;
            });
            this.viewModel.attr('playerList', playerList);
        }
    }
});
The viewModel is:
Mohamed Cherif Bouchelaghem
@cherifGsoul
PlayerBioViewModel is with the new can-define?
Christopher Oliphant
@RALifeCoach
var PlayerBioViewModel = DefineMap.extend({
    name: 'Select Player',
    personalInfo: {
        Value: PlayerBio
    },
    personalResults: {
        Value: PlayerResults
    },
    personalStats: {
        Value: PlayerStats
    },
    personalStat186: {
        Value: PlayerStat186
    },
    playerList: {
        players: []
    },
    showMetric: false
});
Two issue, so far, the values are not being initialized and I can’t update the values from the component events
I have tried this.viewModel.attr(‘property…), this.viewModel.set(‘property’…), this.viewModel.property
For item 1 PlayerStat186 is:
Christopher Oliphant
@RALifeCoach
var PlayerStat186 = DefineMap.extend({
    owgRank: {
        value: ''
    }
});
But in the inserted event playerStat186 is undefined
Mohamed Cherif Bouchelaghem
@cherifGsoul
@RALifeCoach what are the dependencies for the viewModel