Do we need to unbind event listeners in directives when angular starts to destroy?

前端 未结 1 1966
花落未央
花落未央 2020-12-11 00:19

There is a heavy memory leak in my application but I haven\'t found out the causes, and here is the background.

  • I am using AngularJS + JQuery(plugins)
相关标签:
1条回答
  • 2020-12-11 00:56

    The Angular documentation for scope destroy, implies that you do need remove DOM events.

    http://docs.angularjs.org/api/ng.$rootScope.Scope#$destroy

    Note that, in AngularJS, there is also a $destroy jQuery event, which can be used to clean up DOM bindings before an element is removed from the DOM.

    0 讨论(0)
提交回复
热议问题