Is there a way to remove all event listens instantiated by a backbone view? For example, suppose I have the following HTML/JavaScript. When #box is clicked, I want a pop-up to say hello.
<div id="box" style="height: 100px; width: 100px; background-color: red"></div>
var Listener = Backbone.View.extend({
el: "#box",
events: {
'click #box' : 'hello'
},
hello: function () {
alert('hello!');
}
})
var listener = new Listener();
Now, I want to remove the event listener. Setting listener to something else doesn't work:
listener = ''; // doesn't work
How do I remove the event listener?