Hey! I’m building a website with AngularJS and Webflow. Whenever I pull in new content into a existing page I need to call Webflow.init() to make Webflow related features like dropdowns work. Problem is, this creates pretty bad memory leaks from disconnected DOM nodes. I tried to call Webflow.destroy() before I remove anything from the DOM and before rendering a new view but this didn’t help. It seems like some modules (for example the dropdown module) don’t even have a destroy methods defined in webflow.js.
I added destroy methods myself now for features I need but it would be nice if there would be a build-in way to re-initialize Webflow that’s not causing leaks.
https://gist.github.com/schneikai/6d37e1b2822c7a5adf36#file-webflow-dropdown-js