Slide 15
Slide 15 text
Ember.View.extend({
// we need a reference to this
resizeListener: (function({
$.proxy this.windowDidResize, this
}).property(),
windowDidResize: function({
// your logic here
}),
didInsertElement: function({
$(window).on('resize', this.resizeListener)
}),
didRemoveElement: function({
$(window).off('resize', this.resizeListener)
})
});