Where communities thrive


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

    greenkeeper[bot] on can-simple-map-4.3.3

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

  • Oct 14 20:19
    greenkeeper[bot] labeled #5377
  • Oct 14 20:19
    greenkeeper[bot] opened #5377
  • Oct 14 20:19

    greenkeeper[bot] on @feathersjs

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

  • Oct 14 20:18
    greenkeeper[bot] labeled #5376
  • Oct 14 20:18
    greenkeeper[bot] opened #5376
  • Oct 14 20:18

    greenkeeper[bot] on @feathersjs

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

  • Oct 14 14:43
    greenkeeper[bot] closed #5373
  • Oct 14 14:43

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

    (compare)

  • Oct 14 14:42

    m-mujica on update-deep-observable

    (compare)

  • Oct 14 14:42

    m-mujica on master

    Update can-deep-observable to l… Merge pull request #5374 from c… (compare)

  • Oct 14 14:42
    m-mujica closed #5374
  • Oct 14 14:42
    m-mujica closed #5365
  • Oct 14 14:09
    f-ricci starred canjs/canjs
  • Oct 14 13:55
    greenkeeper[bot] commented #5375
  • Oct 14 13:55

    greenkeeper[bot] on core-js-3.3.2

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

  • Oct 14 10:51
    m-mujica review_requested #5374
  • Oct 14 07:43
    rjgotten commented #5358
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
?
Christopher Oliphant
@RALifeCoach
do you mean this? var DefineMap = require('can-define/map/map');
Mohamed Cherif Bouchelaghem
@cherifGsoul
yes what else?
Christopher Oliphant
@RALifeCoach
What are you looking for?
I don’t think there is anything else.
Mohamed Cherif Bouchelaghem
@cherifGsoul
Christopher Oliphant
@RALifeCoach
do I assign it to anything or just require it?
I added can-view-model. this.viewModel.playerStats is still undefined. When I assign this.viewModel.playerList = playerList; I do not get an error, but nor do I see the data in the stache.
Mohamed Cherif Bouchelaghem
@cherifGsoul
I can not realy help you right now
I need time to try it
Christopher Oliphant
@RALifeCoach
I understand. You have a job that requires your attention.
Mohamed Cherif Bouchelaghem
@cherifGsoul
:)
I learn the 3.0 like you :)
Leath Cooper
@IcculusC
hey @RALifeCoach is your code on github somewhere
Christopher Oliphant
@RALifeCoach
Who actually knows it?
No it isn’t on github. It is on my corporate repo.
Leath Cooper
@IcculusC
I've got a decent handle on how it works, but I'm stuck on a big fat glaring error in the event bindings lol
Christopher Oliphant
@RALifeCoach
If you want I can extract the relavent pieces and add them to github