Hi folks,
I'm new in CanJS, hope this question will not be
stupid )
So the question is:
If I bind change event to can.Map object I can see newVal and
oldVal like this:
- var o = new can.Map({});
- o.bind('change', function(ev, attr, how, newVal, oldVal) {
- console.log('Something on o changed.');
- });
but I can't see them if I listen change event inside
can.Control like this:
- var addToCartController = can.Control({},{
- init: function(element, options) {
- // code
- },
- "input change": function(element, event, newValue, oldValue) {
- console.log(newValue); //--> undefined
- console.log(oldValue); //--> undefined
- }
- });
Is this ok? And which is the best way to get oldVal and newVal?
Thanks in advance,
Andrei