These are chat archives for canjs/canjs

29th
Jan 2019
Aliaksei Yanachkin
@ScorpAL
Jan 29 12:29
Guys, do you have any simple pagination example? I would like to paginate ( [1], [2], [3], [4] ) throw already existing list on client side.
Chasen Le Hara
@chasenlehara
Jan 29 17:30
@ScorpAL There’s a “Paginate” example on this page: https://canjs.com/doc/can-component.html#Examples
Does that help?
RanjanSubbiah-tc
@RanjanSubbiah-tc
Jan 29 19:54

hey I was wondering if there an equivalent of this:

const vm = new (ViewModel.extend({ seal: false }, {
    'cachedTownId': {
        'type': 'string',
        'value': undefined
    }
}));

for a functional testing viewmodel:

componentVM = canViewModel(componentFragment.querySelector('page-internet-tv-channel-lineup'));

trying to overwrite a getter in the vm

Kevin Phillips
@phillipskevin
Jan 29 19:55
@RanjanSubbiah-tc you mean the componentVM has a getter and you want to force it to return a specific value?
you'll need to pass lastSet to your getter like shown in this example: https://canjs.com/doc/guides/testing.html#Propertiesderivedfromasynchronousbehavior
then you can just set it like componentVM.whateverThePropertyIs = "whateverValueYouWantItToBe"
RanjanSubbiah-tc
@RanjanSubbiah-tc
Jan 29 19:58
ahh okay, simple enough
thank you