These are chat archives for canjs/canjs

8th
Jan 2017
Gira Minus
@gKreator
Jan 08 2017 22:17
When creating and updating a form with canjs. Does it make sense to update a form model everytime it is changed?
So in a viewModel I keep a name: { type: 'string', value: 'Jeff' }
then update it on input change
rather then reading the value with dom functions later?
than*
Kevin Phillips
@phillipskevin
Jan 08 2017 23:09
you can't easily write tests for code using the dom directly, so I would use the viewModel
Gira Minus
@gKreator
Jan 08 2017 23:10
ok that makes sense
Real quick... what is the best way to re initialize a component that is inside another component?
Kevin Phillips
@phillipskevin
Jan 08 2017 23:11
pass the data in with stache bindings
Gira Minus
@gKreator
Jan 08 2017 23:12
but what if i had logic in the init: function() that i wanted to execute?
Kevin Phillips
@phillipskevin
Jan 08 2017 23:12
depends what that logic does, but there's usually a better place to put that code