Is viewInstance.undelegateEvents () the same as $ (this.el) .unbind ()?

Is it viewInstance.undelegateEvents()

the same as jQuery $(this.el).unbind()

?

Do they work the same way as when removing events from a view?

+3


source to share


1 answer


From http://backbonejs.org/docs/backbone.html#section-131

    undelegateEvents: function() {
      this.$el.unbind('.delegateEvents' + this.cid);
    },

      



So they are almost identical. But the method undelegateEvents

restricts undelegation to events that the kernel has set with the method delegateEvents

using declarative configuration events

in the view.

+6


source







All Articles