Hi there,
I have a can.Contruct that I use as a super class, everything is fine except for the observable listener is not firing:
'{productsObservable} product': function () {
this.activate();
},
The full can.Contruct code
- (function () {'use strict';var HwHellorbotBaseProductCont = can.Construct.extend({setup: function (element, options) {this.element = $(element);this.options = can.extend({},this.constructor.defaults,options);return [this.element, this.options];},init: function (element, options) {var self = this;this.activate();// This is finethis.options.productsObservable.bind('product', function (ev, newVal, oldVal) {self.activate();});},// This form of observable listener is not firing'{productsObservable} product': function () {this.activate();},activate: function () {if (this.options.val === this.options.productsObservable.attr(this.options.pub)) {this.render('transition.slideLeftIn', 1500);}else {this.render('transition.slideRightOut', 200);}},render: function (anim, duration) {this.element.velocity(anim, { duration: duration, easing: 'easeInCubic' });}});window.HwHellorbotBaseProductCont = HwHellorbotBaseProductCont;})();
What did I do wrong?
Rog