These are chat archives for canjs/canjs

Jan 2019
Aliaksei Yanachkin
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
Jan 29 17:30
@ScorpAL There’s a “Paginate” example on this page:
Does that help?
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
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:
then you can just set it like componentVM.whateverThePropertyIs = "whateverValueYouWantItToBe"
Jan 29 19:58
ahh okay, simple enough
thank you