These are chat archives for canjs/canjs

11th
Nov 2015
Sami Pietilä
@smiper
Nov 11 2015 12:59
I have a stupid can.components event related question: should you be able to listen to viewModel changes with this syntax: '{some_value} updated': function() { } ? Oh, and the "some_value" is the component's attribute. I just don't seem to get this to work. Seems like the most logical way to listen to the components attribute changes.
Andrei Balmus
@abalmush
Nov 11 2015 15:46
Hi @smiper , did you try this: “{viewModel} some_value”: function() {} ?
Justin Meyer
@justinbmeyer
Nov 11 2015 20:56
@smiper what's in {CONTEXT} is the context
what you are listening to
CONTEXT.bind
what's after that is the event
{CONTEXT} EVENT => CONTEXT.bind(EVENT, ...
dylanrtt
@dylanrtt
Nov 11 2015 21:03
is it possible to have something like person.attr({'first.name': 'Bob'}) actually do person.attr('first.name', 'Bob') instead of it doing person.attr('first\.name') which I don't want ?